package com.tianqu.tms.core.webservice.weichat.api;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TxController;
import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.core.exception.TransactionException;
import com.tianqu.tms.core.util.DateUtil;
import com.tianqu.tms.core.util.ImageUtils;
import com.tianqu.tms.core.util.Registry;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.core.webservice.weichat.api.impl.CollectCarInfoImpl;
import com.tianqu.tms.core.webservice.weichat.api.rpc.CheckPhotographyInfoBo;
import com.tianqu.tms.core.webservice.weichat.api.rpc.CollectCarInfoBo;
import com.tianqu.tms.core.webservice.weichat.api.rpc.TransferDataSyn000205Bo;
import com.tianqu.tms.core.webservice.weichat.api.rpc.TransferDataSyn438Bo;
import com.tianqu.tms.dao.AttnDao;
import com.tianqu.tms.dao.CarDao;
import com.tianqu.tms.dao.MarketCarHandleInfoDao;
import com.tianqu.tms.dao.MarketCarServiceDao;
import com.tianqu.tms.dao.MemberDao;
import com.tianqu.tms.dao.TmsConfigureDaoimp;
import com.tianqu.tms.dao.TmsDao;
import com.tianqu.tms.dao.TmsTransferFinanceDetailDao;
import com.tianqu.tms.dao.TmsTransferFinanceDetailDaoImp;
import com.tianqu.tms.dao.TransferAcceptedInfoDaoImp;
import com.tianqu.tms.dao.TransferFinanceInfoDaoImp;
import com.tianqu.tms.dao.TransferPersonalCarInfoDaoImp;
import com.tianqu.tms.dao.TransferProcessHistoryDaoImp;
import com.tianqu.tms.dao.UserDaoImp;
import com.tianqu.tms.dto.MarketCarHandleDto;
import com.tianqu.tms.dto.MarketCarInfoDto;
import com.tianqu.tms.dto.MarketCarInfoTempDto;
import com.tianqu.tms.dto.MarketCarServiceDto;
import com.tianqu.tms.dto.MemberDto;
import com.tianqu.tms.dto.PicChangeHistoryDto;
import com.tianqu.tms.dto.TmsFragileStickerHistoryDto;
import com.tianqu.tms.dto.TransferAcceptedInfoDto;
import com.tianqu.tms.dto.TransferFinanceDetailDto;
import com.tianqu.tms.dto.TransferFinanceInfoDto;
import com.tianqu.tms.dto.TransferPersonalCarInfoDto;
import com.tianqu.tms.dto.TransferProcessHistoryDto;
import com.tianqu.tms.dto.TroubleCarInfoDto;
import com.tianqu.tms.dto.UserDto;
import com.tianqu.tms.entity.Attn;
import com.tianqu.tms.entity.Car;
import com.tianqu.tms.entity.CollectCarInfoEntity;
import com.tianqu.tms.entity.IntegralRegister;
import com.tianqu.tms.entity.Member;
import com.tianqu.tms.entity.Sequence;

import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.CheckPhotographyInfo;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.CollectCarInfo;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.RegistrationCarInfo;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.StockRegisterCarInfo;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn000102;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn000204;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn000207;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn000208;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn000209;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn1210;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferDataSyn1211;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferStockQXDataSyn000206;
import net.chedaiban.wechat.api.mq.protobuf.RpcServiceProto.TransferVinDataSyn000205;

public class TmsConsumerService {
	Logger logger = Logger.getLogger(this.getClass());

	private static TmsConsumerService INSTANCE = new TmsConsumerService();

	private TmsConsumerService() {
	}

	public static TmsConsumerService getInstance() {
		return INSTANCE;
	}

	/**
	 * 车辆采集101接口
	 * 
	 * @param checkPhotographyInfo
	 * 
	 * @throws TmsDaoException
	 */
	public void executeCheckPhotographyInfo(CheckPhotographyInfo checkPhotographyInfo) throws TmsDaoException {
		String licensePlate = checkPhotographyInfo.getLicensePlate();
		String vin = checkPhotographyInfo.getVin();
		int cy_cardType = checkPhotographyInfo.getCyCardType();
		String photo_1Url = checkPhotographyInfo.getPhoto1();
		String appUserId = checkPhotographyInfo.getAppUserId();
		String checkUserName = checkPhotographyInfo.getCheckUserName();
		String serialApi = "";
		logger.info("photo_1Url==================>"+photo_1Url);
		// 存放图片绝对地址
		String imgFilePath = TmsConstants.CAR_COLLECTION_PIC_DIRECTORY;
		String imgFileName = TmsConstants.CAR_COLLECTION_PIC_URL;
		String imgDownload = TmsConstants.APP_MQ_IMG_DOWNLOAD;
		// 获取域名之后的路径
		String photo_1 = photo_1Url.substring(photo_1Url.indexOf(imgDownload));
		logger.info("获取域名之后的路径photo_1==================>"+photo_1);

		// 车架号照片
		// String photo_1Name = photo_1.substring(photo_1.lastIndexOf("/") + 1);
		String photo1Filename = imgFilePath.replaceAll(imgFileName, "") + photo_1;
		logger.info("车架号照片photo1Filename==================>"+photo1Filename);
		ImageUtils.httpDownload(photo_1Url, photo1Filename);
		// photo_1 = imgFileName + photo_1Name;// 保存到数据库的照片路径

		if (licensePlate != null && !licensePlate.isEmpty()) {
			TransferAcceptedInfoDto transferAcceptedInfoDto = new TransferAcceptedInfoDto();
			transferAcceptedInfoDto.setLicensePlate(licensePlate);
			TransferAcceptedInfoDaoImp transferAcceptedInfoDao = (TransferAcceptedInfoDaoImp) TransferAcceptedInfoDaoImp
					.getInstance(TmsDao.TMS_TRANSFER_ACCEPTED_INFO);
			TransferAcceptedInfoDto transferAcceptedInfo = transferAcceptedInfoDao
					.selectNumbesByLicensePlateOrVin(transferAcceptedInfoDto);
			//
			if (transferAcceptedInfo != null
					&& (transferAcceptedInfo.getCheckUserid() == 0 || transferAcceptedInfo.getStatus() == 18)) {
				// 如果picChangeNum为空，变成0
				transferAcceptedInfoDao.updatePicChangeNumWhenNull(transferAcceptedInfo);
				// 更新 过户业务基本信息表 (tms_transfer_accepted_info)
				transferAcceptedInfo.setPhoto_1(photo_1);
				transferAcceptedInfoDao.updatePhoto1BySerial(transferAcceptedInfo);
				// 插入 过户流程操作记录表（tms_transfer_process_history）
				TransferProcessHistoryDto transferProcessHistoryDto = new TransferProcessHistoryDto();
				transferProcessHistoryDto.setBusinessType(33);
				transferProcessHistoryDto.setInsertUserId(1);
				String serial = transferAcceptedInfo.getSerial();
				serialApi = serial;
				transferProcessHistoryDto.setSerial(serial);
				TransferProcessHistoryDaoImp transferProcessHistoryDao = (TransferProcessHistoryDaoImp) TransferProcessHistoryDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
				transferProcessHistoryDao.insertHisInfoBySerial(transferProcessHistoryDto);
				
				// 插入 pad历史记录表（tms_pad_history）
				PicChangeHistoryDto picChangeHistoryDto = new PicChangeHistoryDto();
				picChangeHistoryDto.setSerial(serial);// 车辆流水号（serial）为关联的过户业务基本信息表 （tms_transfer_accepted_info）的车辆流水号（serial）
				picChangeHistoryDto.setLicensePlate(licensePlate);// 车牌号码（licensePlate）为传入的车牌号码
				picChangeHistoryDto.setSuccessFlag(1);// 是否上传成功（successFlag）为“1：成功”
				picChangeHistoryDto.setOperateFlag(2);// 操作方式（operateFlag）为“2：更新”
				picChangeHistoryDto.setInsertUserId(appUserId);// 微信号（insertUserId）为传入的微信号
				picChangeHistoryDto.setUserName(checkUserName);// 查验照相人员（userName）为传入的操作人姓名
				transferProcessHistoryDao.insertPicChangeHistory(picChangeHistoryDto);
				 
			} else {
				// 插入 过户业务基本信息表 (tms_transfer_accepted_info)
				String serial = Sequence.getInstance().getSerial(6);
				serialApi = serial;
				transferAcceptedInfoDto.setSerial(serial);
				transferAcceptedInfoDto.setMarketType(2);
				transferAcceptedInfoDto.setLicensePlate(licensePlate);
				transferAcceptedInfoDto.setCardType(cy_cardType);
				transferAcceptedInfoDto.setCarClass(2);
				transferAcceptedInfoDto.setPhoto_1(photo_1);
				if (cy_cardType == 0) {
					transferAcceptedInfoDto.setLicensePlateCol("2");
				} else if (cy_cardType == 1) {
					transferAcceptedInfoDto.setLicensePlateCol("1");
				}
				transferAcceptedInfoDto.setStatus(1);
				transferAcceptedInfoDto.setInsertUserid(1);
				transferAcceptedInfoDto.setUpdateUserId(1);
				transferAcceptedInfoDto.setVinNum("1");
				transferAcceptedInfoDto.setEngineNum("1");
				transferAcceptedInfoDto.setBrandModel("1");
				transferAcceptedInfoDto.setPlateOrTireExterior("1");
				transferAcceptedInfoDto.setTireIntact("1");
				transferAcceptedInfoDto.setSeatBelt("1");
				transferAcceptedInfoDao.insertCarInfoAtWX(transferAcceptedInfoDto);

				// 插入 过户流程操作记录表（tms_transfer_process_history）
				TransferProcessHistoryDto transferProcessHistoryDto = new TransferProcessHistoryDto();
				transferProcessHistoryDto.setSerial(serial);
				transferProcessHistoryDto.setBusinessType(1);
				transferProcessHistoryDto.setInsertUserId(1);
				TransferProcessHistoryDaoImp transferProcessHistoryDao = (TransferProcessHistoryDaoImp) TransferProcessHistoryDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
				transferProcessHistoryDao.insertHisInfoBySerial(transferProcessHistoryDto);
			
				// 插入 pad历史记录表（tms_pad_history）
				PicChangeHistoryDto picChangeHistoryDto = new PicChangeHistoryDto();
				picChangeHistoryDto.setSerial(serial);// 车辆流水号（serial）为关联的过户业务基本信息表 （tms_transfer_accepted_info）的车辆流水号（serial）
				picChangeHistoryDto.setLicensePlate(licensePlate);// 车牌号码（licensePlate）为传入的车牌号码
				picChangeHistoryDto.setSuccessFlag(1);// 是否上传成功（successFlag）为“1：成功”
				picChangeHistoryDto.setOperateFlag(1);// 操作方式（operateFlag）为“1：插入”
				picChangeHistoryDto.setInsertUserId(appUserId);// 微信号（insertUserId）为传入的微信号
				picChangeHistoryDto.setUserName(checkUserName);// 查验照相人员（userName）为传入的操作人姓名
				transferProcessHistoryDao.insertPicChangeHistory(picChangeHistoryDto);

				// 插入 tms_transfer_finance_info（过户业务财务收费信息表）
				TransferFinanceInfoDaoImp transferFinanceInfoDao = (TransferFinanceInfoDaoImp) TransferFinanceInfoDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_FINANCE_INFO);
				transferFinanceInfoDao.insertFinanceByInner(serial);

				CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
						.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
				MarketCarInfoDto marketCarInfoDto = collectCarInfoDao.findMarketCarInfoListByLicensePlate(licensePlate);
				// 是库存车辆
				if (marketCarInfoDto != null) {
					MarketCarServiceDto marketCarServiceDto = new MarketCarServiceDto();
					String serviceSerial = marketCarInfoDto.getSerial();
					marketCarServiceDto = collectCarInfoDao.findMarketCarServiceBySerial(serviceSerial);
					// 更新 过户业务基本信息表（tms_transfer_accepted_info）
					TransferAcceptedInfoDto transferAcceptedInfoHasNum = new TransferAcceptedInfoDto();
					transferAcceptedInfoHasNum.setSerial(serial);
					transferAcceptedInfoHasNum.setMarketType(1);
					transferAcceptedInfoHasNum.setTransferPrice(2);
					transferAcceptedInfoHasNum.setBasicCarId(marketCarInfoDto.getSerial());
					transferAcceptedInfoHasNum.setVin(marketCarInfoDto.getVin());
					transferAcceptedInfoHasNum.setVendorId(marketCarInfoDto.getVendorId());
					transferAcceptedInfoHasNum.setBrandId(marketCarInfoDto.getBrandId());
					transferAcceptedInfoHasNum.setCarStyleId(marketCarInfoDto.getCarStyleId());
					transferAcceptedInfoHasNum.setCarName(marketCarInfoDto.getCarName());
					transferAcceptedInfoHasNum.setIsMatch(marketCarInfoDto.getIsMatch());
					transferAcceptedInfoHasNum.setPhoto_1(marketCarInfoDto.getPhoto_1());
					transferAcceptedInfoHasNum.setMemberId(String.valueOf(marketCarInfoDto.getMemberId()));
					transferAcceptedInfoDao.updateAcceptedInfoBySerial(transferAcceptedInfoHasNum);
					// 如果当前车辆关联的库存车辆业务表（tms_market_car_service）的交易票缴费（transferPrice）不为“0”，那么插入
					// 过户流程操作记录表（tms_transfer_process_history）
					if (marketCarServiceDto.getTransferPrice() != 0) {
						TransferProcessHistoryDto transferProcessHistoryHasNum = new TransferProcessHistoryDto();
						transferProcessHistoryHasNum.setSerial(serial);
						transferProcessHistoryHasNum.setBusinessType(8);
						transferProcessHistoryHasNum.setInsertUserId(1);
						transferProcessHistoryDao.insertHisInfoBySerial(transferProcessHistoryHasNum);
					}
					TransferFinanceInfoDto transferFinanceInfoDto = new TransferFinanceInfoDto();
					// 更新 tms_transfer_finance_info（过户业务的财务收费信息表）
					if (marketCarServiceDto.getCheckPrice() != 0) {
						transferFinanceInfoDto.setSerial(serial);
						transferFinanceInfoDto.setCheckPrice(marketCarServiceDto.getCheckPrice());
						transferFinanceInfoDto.setCheckPriceUserId(1);
						transferFinanceInfoDto.setCheckPriceChargeType(3);
						transferFinanceInfoDao.updateFinanceInfoAtWXByCheckPrice(transferFinanceInfoDto);

					}
					if (marketCarServiceDto.getTransferPrice() != 0) {
						transferFinanceInfoDto.setSerial(serial);
						transferFinanceInfoDto.setTransferPrice(marketCarServiceDto.getTransferPrice());
						transferFinanceInfoDto.setTransferPriceUserId(1);
						transferFinanceInfoDto.setTransferPriceChargeType(3);
						transferFinanceInfoDao.updateFinanceInfoAtWXByTransferPrice(transferFinanceInfoDto);
					}
					MarketCarServiceDto marketCarServiceDtoHasNum = new MarketCarServiceDto();
					marketCarServiceDtoHasNum.setSerial(marketCarServiceDto.getSerial());
					marketCarServiceDtoHasNum.setCheckStatus(1);
					marketCarServiceDtoHasNum.setCheckImgPath(null);
					marketCarServiceDtoHasNum.setCheckUser(null);
					marketCarServiceDtoHasNum.setCheckTime(null);
					marketCarServiceDtoHasNum.setCheckValidTime(null);
					marketCarServiceDtoHasNum.setIsValid(3);
					marketCarServiceDtoHasNum.setCheckPrice(0);
					marketCarServiceDtoHasNum.setTransferPrice(0);
					collectCarInfoDao.updateMarketCarInfoService(marketCarServiceDtoHasNum);

					// 401接口准备
					TransferAcceptedInfoDto obj = transferAcceptedInfoDao.findTransfeAcceptedInfoBy401(serial);

					// 需求说明本_tms_web.xlsx/微信平台同步接口/过户同步的接口编号：401
					CheckPhotographyInfoBo checkPhotographyInfoBo = new CheckPhotographyInfoBo();
					checkPhotographyInfoBo.setSerial(obj.getSerial());// 车辆流水号
					checkPhotographyInfoBo.setMarketType(obj.getMarketType());// 车辆库存类型
					checkPhotographyInfoBo.setLicensePlate(obj.getLicensePlate());// 车牌号码
					checkPhotographyInfoBo.setCy_cardType(obj.getCardType());// 号牌种类
					checkPhotographyInfoBo.setCarClass(obj.getCarClass());// 车辆分类
					checkPhotographyInfoBo.setCarOwner(null);// 原车主姓名
					checkPhotographyInfoBo.setLicenseType(obj.getLicensePlateCol());// 号牌颜色
					checkPhotographyInfoBo.setBasicCarId(obj.getBasicCarId());// 车辆编号
					checkPhotographyInfoBo.setVin(obj.getVin());// 车架号
					checkPhotographyInfoBo.setVendorId(obj.getVendorId());// 车辆品牌Id
					checkPhotographyInfoBo.setBrandId(obj.getBrandId());// 车系Id
					checkPhotographyInfoBo.setCarStyleId(obj.getCarStyleId());// 车辆款式Id
					checkPhotographyInfoBo.setCarName(obj.getCarName());// 车辆名称
					checkPhotographyInfoBo.setDetailStatus(1);// 车辆过户状态
					checkPhotographyInfoBo.setIsMatch(obj.getIsMatch());// 车款是否配对
					checkPhotographyInfoBo.setPhoto_1(obj.getPhoto_1());// 查验照片
					checkPhotographyInfoBo.setMemberId(obj.getMemberId());// 商户会员ID
					checkPhotographyInfoBo.setStatus(2);// 车辆过户状态
					TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp
							.getInstance(TmsDao.TMS_CONFIGURE);
					String userMarket = tmsConfigureDao.getConfig("maketNo");// 过户市场
					checkPhotographyInfoBo.setUserMarket(userMarket);

					WeChatMqApi.getInstance().call(checkPhotographyInfoBo);

				} else {
					// 未关联库存车辆
					// 插入 非库存车辆信息表
					TransferPersonalCarInfoDto transferPersonalCarInfoDto = new TransferPersonalCarInfoDto();
					String personSerial = Sequence.getInstance().getSerial(5);
					transferPersonalCarInfoDto.setSerial(personSerial);
					transferPersonalCarInfoDto.setStatus(3);
					transferPersonalCarInfoDto.setLicensePlate(licensePlate);
					transferPersonalCarInfoDto.setInsertUserId(1);
					transferPersonalCarInfoDto.setUpdateUserId(1);
					TransferPersonalCarInfoDaoImp transferPersonalCarInfoDao = (TransferPersonalCarInfoDaoImp) TransferPersonalCarInfoDaoImp
							.getInstance(TmsDao.TMS_TRANSFER_PERSONALCAR_INFO);
					transferPersonalCarInfoDao.insertCarBaseInfoAtWX(transferPersonalCarInfoDto);

					// 更新 过户业务基本信息表（tms_transfer_accepted_info）
					TransferAcceptedInfoDto obj = new TransferAcceptedInfoDto();
					obj.setBasicCarId(personSerial);
					obj.setSerial(serial);
					transferAcceptedInfoDao.updateBasicCarIdBySerial(obj);
					// 需求说明本_tms_web.xlsx/微信平台同步接口/过户同步的接口编号：401
					// 401接口准备
					TransferAcceptedInfoDto obj401 = transferAcceptedInfoDao.findTransfeAcceptedInfoBy401(serial);

					CheckPhotographyInfoBo checkPhotographyInfoBo = new CheckPhotographyInfoBo();
					checkPhotographyInfoBo.setSerial(obj401.getSerial());// 车辆流水号
					checkPhotographyInfoBo.setMarketType(obj401.getMarketType());// 车辆库存类型
					checkPhotographyInfoBo.setLicensePlate(obj401.getLicensePlate());// 车牌号码
					checkPhotographyInfoBo.setCy_cardType(obj401.getCardType());// 号牌种类
					checkPhotographyInfoBo.setCarClass(obj401.getCarClass());// 车辆分类
					checkPhotographyInfoBo.setCarOwner(null);// 原车主姓名
					checkPhotographyInfoBo.setLicenseType(obj401.getLicensePlateCol());// 号牌颜色
					checkPhotographyInfoBo.setBasicCarId(personSerial);// 车辆编号
					checkPhotographyInfoBo.setVin(obj401.getVin());// 车架号
					checkPhotographyInfoBo.setVendorId(obj401.getVendorId());// 车辆品牌Id
					checkPhotographyInfoBo.setBrandId(obj401.getBrandId());// 车系Id
					checkPhotographyInfoBo.setCarStyleId(obj401.getCarStyleId());// 车辆款式Id
					checkPhotographyInfoBo.setCarName(obj401.getCarName());// 车辆名称
					checkPhotographyInfoBo.setDetailStatus(1);// 车辆过户状态
					checkPhotographyInfoBo.setIsMatch(obj401.getIsMatch());// 车款是否配对
					checkPhotographyInfoBo.setPhoto_1(obj401.getPhoto_1());// 查验照片
					checkPhotographyInfoBo.setMemberId(obj401.getMemberId());// 商户会员ID
					checkPhotographyInfoBo.setStatus(2);// 车辆过户状态
					TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp
							.getInstance(TmsDao.TMS_CONFIGURE);
					String userMarket = tmsConfigureDao.getConfig("maketNo");// 过户市场
					checkPhotographyInfoBo.setUserMarket(userMarket);
					WeChatMqApi.getInstance().call(checkPhotographyInfoBo);

				}

			}

		} else if (vin != null && !vin.isEmpty()) {
			TransferAcceptedInfoDto transferAcceptedInfoDto = new TransferAcceptedInfoDto();
			transferAcceptedInfoDto.setVin(vin);
			TransferAcceptedInfoDaoImp transferAcceptedInfoDao = (TransferAcceptedInfoDaoImp) TransferAcceptedInfoDaoImp
					.getInstance(TmsDao.TMS_TRANSFER_ACCEPTED_INFO);
			TransferAcceptedInfoDto transferAcceptedInfo = transferAcceptedInfoDao
					.selectNumbesByLicensePlateOrVin(transferAcceptedInfoDto);
			if (transferAcceptedInfo != null
					&& (transferAcceptedInfo.getCheckUserid() == 0 || transferAcceptedInfo.getStatus() == 18)) {
				// 更新 过户业务基本信息表 (tms_transfer_accepted_info)
				transferAcceptedInfo.setPhoto_1(photo_1);
				// 如果picChangeNum为空，变成0
				transferAcceptedInfoDao.updatePicChangeNumWhenNull(transferAcceptedInfo);
				transferAcceptedInfoDao.updatePhoto1BySerial(transferAcceptedInfo);
				// 插入 过户流程操作记录表（tms_transfer_process_history）
				TransferProcessHistoryDto transferProcessHistoryDto = new TransferProcessHistoryDto();
				transferProcessHistoryDto.setBusinessType(33);
				transferProcessHistoryDto.setInsertUserId(1);
				String serial = transferAcceptedInfo.getSerial();
				serialApi = serial;
				transferProcessHistoryDto.setSerial(serial);
				TransferProcessHistoryDaoImp transferProcessHistoryDao = (TransferProcessHistoryDaoImp) TransferProcessHistoryDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
				transferProcessHistoryDao.insertHisInfoBySerial(transferProcessHistoryDto);

				// 插入 pad历史记录表（tms_pad_history）
				PicChangeHistoryDto picChangeHistoryDto = new PicChangeHistoryDto();
				picChangeHistoryDto.setSerial(serial);// 车辆流水号（serial）为关联的过户业务基本信息表 （tms_transfer_accepted_info）的车辆流水号（serial）
				picChangeHistoryDto.setLicensePlate(licensePlate);// 车牌号码（licensePlate）为传入的车牌号码
				picChangeHistoryDto.setSuccessFlag(1);// 是否上传成功（successFlag）为“1：成功”
				picChangeHistoryDto.setOperateFlag(2);// 操作方式（operateFlag）为“2：更新”
				picChangeHistoryDto.setInsertUserId(appUserId);// 微信号（insertUserId）为传入的微信号
				picChangeHistoryDto.setUserName(checkUserName);// 查验照相人员（userName）为传入的操作人姓名
				transferProcessHistoryDao.insertPicChangeHistory(picChangeHistoryDto);
			} else {
				// 插入 过户业务基本信息表 (tms_transfer_accepted_info)
				String serial = Sequence.getInstance().getSerial(6);
				serialApi = serial;
				transferAcceptedInfoDto.setSerial(serial);
				transferAcceptedInfoDto.setMarketType(2);
				transferAcceptedInfoDto.setVin(vin);
				transferAcceptedInfoDto.setCardType(cy_cardType);
				transferAcceptedInfoDto.setCarClass(1);
				transferAcceptedInfoDto.setPhoto_1(photo_1);
				if (cy_cardType == 0) {
					transferAcceptedInfoDto.setLicensePlateCol("2");
				} else if (cy_cardType == 1) {
					transferAcceptedInfoDto.setLicensePlateCol("1");
				}
				transferAcceptedInfoDto.setStatus(1);
				transferAcceptedInfoDto.setInsertUserid(1);
				transferAcceptedInfoDto.setUpdateUserId(1);
				transferAcceptedInfoDto.setVinNum("1");
				transferAcceptedInfoDto.setEngineNum("1");
				transferAcceptedInfoDto.setBrandModel("1");
				transferAcceptedInfoDto.setPlateOrTireExterior("1");
				transferAcceptedInfoDto.setTireIntact("1");
				transferAcceptedInfoDto.setSeatBelt("1");
				transferAcceptedInfoDao.insertCarInfoAtWX(transferAcceptedInfoDto);

				// 插入 过户流程操作记录表（tms_transfer_process_history）
				TransferProcessHistoryDto transferProcessHistoryDto = new TransferProcessHistoryDto();
				transferProcessHistoryDto.setSerial(serial);
				transferProcessHistoryDto.setBusinessType(1);
				transferProcessHistoryDto.setInsertUserId(1);
				TransferProcessHistoryDaoImp transferProcessHistoryDao = (TransferProcessHistoryDaoImp) TransferProcessHistoryDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
				transferProcessHistoryDao.insertHisInfoBySerial(transferProcessHistoryDto);

				// 插入 pad历史记录表（tms_pad_history）
				PicChangeHistoryDto picChangeHistoryDto = new PicChangeHistoryDto();
				picChangeHistoryDto.setSerial(serial);// 车辆流水号（serial）为关联的过户业务基本信息表 （tms_transfer_accepted_info）的车辆流水号（serial）
				picChangeHistoryDto.setLicensePlate(licensePlate);// 车牌号码（licensePlate）为传入的车牌号码
				picChangeHistoryDto.setSuccessFlag(1);// 是否上传成功（successFlag）为“1：成功”
				picChangeHistoryDto.setOperateFlag(1);// 操作方式（operateFlag）为“1：插入”
				picChangeHistoryDto.setInsertUserId(appUserId);// 微信号（insertUserId）为传入的微信号
				picChangeHistoryDto.setUserName(checkUserName);// 查验照相人员（userName）为传入的操作人姓名
				transferProcessHistoryDao.insertPicChangeHistory(picChangeHistoryDto);

				// 插入 tms_transfer_finance_info（过户业务财务收费信息表）
				TransferFinanceInfoDaoImp transferFinanceInfoDao = (TransferFinanceInfoDaoImp) TransferFinanceInfoDaoImp
						.getInstance(TmsDao.TMS_TRANSFER_FINANCE_INFO);
				transferFinanceInfoDao.insertFinanceByInner(serial);

				CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
						.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
				MarketCarInfoDto marketCarInfoDto = collectCarInfoDao.findMarketCarInfoListByVinAll(vin);
				if (marketCarInfoDto != null) {
					// 更新 过户业务基本信息表（tms_transfer_accepted_info）
					TransferAcceptedInfoDto transferAcceptedInfoHasNum = new TransferAcceptedInfoDto();
					transferAcceptedInfoHasNum.setSerial(serial);
					transferAcceptedInfoHasNum.setMarketType(1);
					transferAcceptedInfoHasNum.setBasicCarId(marketCarInfoDto.getSerial());
					transferAcceptedInfoHasNum.setVin(marketCarInfoDto.getVin());
					transferAcceptedInfoHasNum.setVendorId(marketCarInfoDto.getVendorId());
					transferAcceptedInfoHasNum.setBrandId(marketCarInfoDto.getBrandId());
					transferAcceptedInfoHasNum.setCarStyleId(marketCarInfoDto.getCarStyleId());
					transferAcceptedInfoHasNum.setCarName(marketCarInfoDto.getCarName());
					transferAcceptedInfoHasNum.setIsMatch(marketCarInfoDto.getIsMatch());
					transferAcceptedInfoHasNum.setPhoto_1(marketCarInfoDto.getPhoto_1());
					transferAcceptedInfoHasNum.setMemberId(String.valueOf(marketCarInfoDto.getMemberId()));
					transferAcceptedInfoDao.updateAcceptedInfoBySerialNewCar(transferAcceptedInfoHasNum);

					// 更新 tms_transfer_finance_info（过户业务的财务收费信息表）
					MarketCarServiceDto marketCarServiceDto = new MarketCarServiceDto();
					String serviceSerial = marketCarInfoDto.getSerial();
					marketCarServiceDto = collectCarInfoDao.findMarketCarServiceBySerial(serviceSerial);
					TransferFinanceInfoDto transferFinanceInfoDto = new TransferFinanceInfoDto();
					if (marketCarServiceDto.getCheckPrice() != 0) {
						transferFinanceInfoDto.setSerial(serial);
						transferFinanceInfoDto.setCheckPrice(
								marketCarServiceDto.getCheckPrice() + marketCarServiceDto.getTransferPrice());
						transferFinanceInfoDto.setCheckPriceUserId(1);
						transferFinanceInfoDto.setCheckPriceChargeType(3);
						transferFinanceInfoDao.updateFinanceInfoAtWXByCheckPrice(transferFinanceInfoDto);
					}
					// 更新 库存车辆业务表（tms_market_car_service）
					MarketCarServiceDto marketCarServiceDtoHasNum = new MarketCarServiceDto();
					marketCarServiceDtoHasNum.setSerial(marketCarServiceDto.getSerial());
					marketCarServiceDtoHasNum.setCheckStatus(1);
					marketCarServiceDtoHasNum.setCheckImgPath(null);
					marketCarServiceDtoHasNum.setCheckUser(null);
					marketCarServiceDtoHasNum.setCheckTime(null);
					marketCarServiceDtoHasNum.setCheckValidTime(null);
					marketCarServiceDtoHasNum.setIsValid(3);
					marketCarServiceDtoHasNum.setCheckPrice(0);
					marketCarServiceDtoHasNum.setTransferPrice(0);
					collectCarInfoDao.updateMarketCarInfoService(marketCarServiceDtoHasNum);
					// 需求说明本_tms_web.xlsx/微信平台同步接口/过户同步的接口编号：401

					// 401接口准备
					TransferAcceptedInfoDto obj = transferAcceptedInfoDao.findTransfeAcceptedInfoBy401(serial);
					// 需求说明本_tms_web.xlsx/微信平台同步接口/过户同步的接口编号：401
					CheckPhotographyInfoBo checkPhotographyInfoBo = new CheckPhotographyInfoBo();
					checkPhotographyInfoBo.setSerial(obj.getSerial());// 车辆流水号
					checkPhotographyInfoBo.setMarketType(obj.getMarketType());// 车辆库存类型
					checkPhotographyInfoBo.setLicensePlate(obj.getLicensePlate());// 车牌号码
					checkPhotographyInfoBo.setCy_cardType(obj.getCardType());// 号牌种类
					checkPhotographyInfoBo.setCarClass(obj.getCarClass());// 车辆分类
					checkPhotographyInfoBo.setCarOwner(null);// 原车主姓名
					checkPhotographyInfoBo.setLicenseType(obj.getLicensePlateCol());// 号牌颜色
					checkPhotographyInfoBo.setBasicCarId(obj.getBasicCarId());// 车辆编号
					checkPhotographyInfoBo.setVin(obj.getVin());// 车架号
					checkPhotographyInfoBo.setVendorId(obj.getVendorId());// 车辆品牌Id
					checkPhotographyInfoBo.setBrandId(obj.getBrandId());// 车系Id
					checkPhotographyInfoBo.setCarStyleId(obj.getCarStyleId());// 车辆款式Id
					checkPhotographyInfoBo.setCarName(obj.getCarName());// 车辆名称
					checkPhotographyInfoBo.setDetailStatus(1);// 车辆过户状态
					checkPhotographyInfoBo.setIsMatch(obj.getIsMatch());// 车款是否配对
					checkPhotographyInfoBo.setPhoto_1(obj.getPhoto_1());// 查验照片
					checkPhotographyInfoBo.setMemberId(obj.getMemberId());// 商户会员ID
					checkPhotographyInfoBo.setStatus(2);// 车辆过户状态
					TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp
							.getInstance(TmsDao.TMS_CONFIGURE);
					String userMarket = tmsConfigureDao.getConfig("maketNo");// 过户市场
					checkPhotographyInfoBo.setUserMarket(userMarket);

					WeChatMqApi.getInstance().call(checkPhotographyInfoBo);

				} else {
					// 未关联库存车辆
					// 插入 非库存车辆信息表
					TransferPersonalCarInfoDto transferPersonalCarInfoDto = new TransferPersonalCarInfoDto();
					String personSerial = Sequence.getInstance().getSerial(5);
					transferPersonalCarInfoDto.setSerial(personSerial);
					transferPersonalCarInfoDto.setStatus(3);
					transferPersonalCarInfoDto.setVin(vin);
					transferPersonalCarInfoDto.setInsertUserId(1);
					transferPersonalCarInfoDto.setUpdateUserId(1);
					TransferPersonalCarInfoDaoImp transferPersonalCarInfoDao = (TransferPersonalCarInfoDaoImp) TransferPersonalCarInfoDaoImp
							.getInstance(TmsDao.TMS_TRANSFER_PERSONALCAR_INFO);
					transferPersonalCarInfoDao.insertCarBaseInfoAtWX(transferPersonalCarInfoDto);
					// 更新 过户业务基本信息表（tms_transfer_accepted_info）
					TransferAcceptedInfoDto obj = new TransferAcceptedInfoDto();
					obj.setBasicCarId(personSerial);
					obj.setSerial(serial);
					transferAcceptedInfoDao.updateBasicCarIdBySerial(obj);
					// 需求说明本_tms_web.xlsx/微信平台同步接口/过户同步的接口编号：401

					// 401接口准备
					TransferAcceptedInfoDto obj401 = transferAcceptedInfoDao.findTransfeAcceptedInfoBy401(serial);

					CheckPhotographyInfoBo checkPhotographyInfoBo = new CheckPhotographyInfoBo();
					checkPhotographyInfoBo.setSerial(obj401.getSerial());// 车辆流水号
					checkPhotographyInfoBo.setMarketType(obj401.getMarketType());// 车辆库存类型
					checkPhotographyInfoBo.setLicensePlate(obj401.getLicensePlate());// 车牌号码
					checkPhotographyInfoBo.setCy_cardType(obj401.getCardType());// 号牌种类
					checkPhotographyInfoBo.setCarClass(obj401.getCarClass());// 车辆分类
					checkPhotographyInfoBo.setCarOwner(null);// 原车主姓名
					checkPhotographyInfoBo.setLicenseType(obj401.getLicensePlateCol());// 号牌颜色
					checkPhotographyInfoBo.setBasicCarId(personSerial);// 车辆编号
					checkPhotographyInfoBo.setVin(obj401.getVin());// 车架号
					checkPhotographyInfoBo.setVendorId(obj401.getVendorId());// 车辆品牌Id
					checkPhotographyInfoBo.setBrandId(obj401.getBrandId());// 车系Id
					checkPhotographyInfoBo.setCarStyleId(obj401.getCarStyleId());// 车辆款式Id
					checkPhotographyInfoBo.setCarName(obj401.getCarName());// 车辆名称
					checkPhotographyInfoBo.setDetailStatus(1);// 车辆过户状态
					checkPhotographyInfoBo.setIsMatch(obj401.getIsMatch());// 车款是否配对
					checkPhotographyInfoBo.setPhoto_1(obj401.getPhoto_1());// 查验照片
					checkPhotographyInfoBo.setMemberId(obj401.getMemberId());// 商户会员ID
					checkPhotographyInfoBo.setStatus(2);// 车辆过户状态
					TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp
							.getInstance(TmsDao.TMS_CONFIGURE);
					String userMarket = tmsConfigureDao.getConfig("maketNo");// 过户市场
					checkPhotographyInfoBo.setUserMarket(userMarket);
					WeChatMqApi.getInstance().call(checkPhotographyInfoBo);
				}
			}
		}
		
		//同步数据到手机新框架
		try {
			TransferDataSyn438Bo transferDataSyn438Bo = new TransferDataSyn438Bo();
			transferDataSyn438Bo.setVin(vin);
			transferDataSyn438Bo.setLicensePlate(licensePlate);
			transferDataSyn438Bo.setCyCardType(String.valueOf(cy_cardType));
			TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp.getInstance(TmsDao.TMS_CONFIGURE);
			String markteNo = tmsConfigureDao.getConfig("maketNo");// 过户市场
			transferDataSyn438Bo.setMarkteNo(markteNo);
			transferDataSyn438Bo.setSerial(serialApi);
			transferDataSyn438Bo.setPhoto1(ImageUtils.transPicToStr(photo1Filename));
			WeChatMqApi.getInstance().call(transferDataSyn438Bo, false);
		} catch (Exception e) {
			logger.error(e);
		}
	}

	public void executeRegistrationCarInfo(RegistrationCarInfo registrationCarInfo) throws TmsDaoException {
		String serial = registrationCarInfo.getSerial();
		CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
				.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
		// int count = collectCarInfoDao.findMarketCarInfoCountBySerial(serial);
		int color = registrationCarInfo.getColor();
		String licensePlate = registrationCarInfo.getLicensePlate();
		int isShelve = registrationCarInfo.getIsShelve();
		int entryStatus = registrationCarInfo.getEntryStatus();
		int registerStatus = registrationCarInfo.getRegisterStatus();
		String memberId = registrationCarInfo.getMemberId();
		int insertUserId = registrationCarInfo.getInsertUserId();
		int updateUserId = registrationCarInfo.getInsertUserId();
		MarketCarInfoDto marketCarInfoDtoByFind = collectCarInfoDao.findMarketCarInfoBySerial(serial);
		if (marketCarInfoDtoByFind != null) {
			int id = marketCarInfoDtoByFind.getId();
			MarketCarInfoDto updateCar = new MarketCarInfoDto();
			updateCar.setId(id);
			updateCar.setColor(color);
			updateCar.setLicensePlate(licensePlate);
			updateCar.setIsShelve(isShelve);
			updateCar.setEntryStatus(entryStatus);
			updateCar.setRegisterStatus(registerStatus);
			updateCar.setMemberId(Integer.parseInt(memberId));
			updateCar.setInsertUserId(insertUserId);
			updateCar.setUpdateUserId(updateUserId);
			collectCarInfoDao.updateSyncMarketCarInfo(updateCar);
		} else {
			MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
			marketCarInfoDto.setSerial(serial);
			marketCarInfoDto.setColor(color);
			marketCarInfoDto.setLicensePlate(licensePlate);
			marketCarInfoDto.setIsShelve(isShelve);
			marketCarInfoDto.setEntryStatus(entryStatus);
			marketCarInfoDto.setRegisterStatus(registerStatus);
			marketCarInfoDto.setMemberId(Integer.parseInt(memberId));
			marketCarInfoDto.setInsertUserId(insertUserId);
			marketCarInfoDto.setUpdateUserId(updateUserId);

			collectCarInfoDao.insertMarketCarInfo(marketCarInfoDto);
		}
	}

	public void executeCollectCarInfo(CollectCarInfo collectCarInfo) throws TmsDaoException {
		// logger.info(" 入参:"+ JSON.toJSONString(collectCarInfo)+"-----------");
		// 2为正常状态
		int tag1Skip = collectCarInfo.getTag1Skip();// 信息采集是否跳过
		int tag2Skip = collectCarInfo.getTag2Skip();// 车辆检测是否跳过
		int tag3Skip = collectCarInfo.getTag3Skip();// 车辆查验是否跳过
		String tempLicensePlate =collectCarInfo.getTempLicensePlate(); // 易碎贴编号
		
		if(StringUtil.isNotBlank(tempLicensePlate)) tempLicensePlate = tempLicensePlate.trim();

		String vinCode = collectCarInfo.getVinCode();
		// String phohoVinInfo = collectCarInfo.getPhotoVinInfo();
		String phohoVinPath = collectCarInfo.getPhotoVinPath();
		// String carImgInfo = collectCarInfo.getCarImgInfo();
		String photo1 = collectCarInfo.getPhoto1();
		String photo2 = collectCarInfo.getPhoto2();
		String photo3 = collectCarInfo.getPhoto3();
		String photo4 = collectCarInfo.getPhoto4();
		String photo5 = collectCarInfo.getPhoto5();
		String photo6 = collectCarInfo.getPhoto6();
		String photo7 = collectCarInfo.getPhoto7();
		String photo8 = collectCarInfo.getPhoto8();
		int mileage = collectCarInfo.getMileage();
		int attestStatus = collectCarInfo.getAttestStatus();
		int checkStatus = collectCarInfo.getCheckStatus();
		// String checkImgInfo = collectCarInfo.getCheckImgInfo();
		// String checkImgPath = collectCarInfo.getCheckImgPath();
		String insertTime = collectCarInfo.getInsertTime();
		String insertUserName = collectCarInfo.getInsertUserName();
		int marketNo = collectCarInfo.getMarketNo();
		int color = collectCarInfo.getColor();
		String checkPhoto1 = collectCarInfo.getCheckPhoto1();
		String checkPhoto2 = collectCarInfo.getCheckPhoto2();
		String checkPhoto3 = collectCarInfo.getCheckPhoto3();
		String checkPhoto4 = collectCarInfo.getCheckPhoto4();
		String checkPhoto5 = collectCarInfo.getCheckPhoto5();
		String checkPhoto6 = collectCarInfo.getCheckPhoto6();
		String checkPhoto7 = collectCarInfo.getCheckPhoto7();
		String checkPhoto8 = collectCarInfo.getCheckPhoto8();
		String checkPhoto9 = collectCarInfo.getCheckPhoto9();
		String checkPhoto10 = collectCarInfo.getCheckPhoto10();
		String checkPhoto11 = collectCarInfo.getCheckPhoto11();
		String checkPhoto12 = collectCarInfo.getCheckPhoto12();
		String checkPhoto13 = collectCarInfo.getCheckPhoto13();
		String checkPhoto14 = collectCarInfo.getCheckPhoto14();
		String checkPhoto15 = collectCarInfo.getCheckPhoto15();
		// String checkPicImgInfo = collectCarInfo.getCheckPicImgInfo();
		String checkPicImgPath = collectCarInfo.getCheckPicImgPath();

		CollectCarInfoEntity collectCarInfoEntity = new CollectCarInfoEntity();
		collectCarInfoEntity.setVinCode(vinCode);
		// collectCarInfoEntity.setPhotoVinInfo(phohoVinInfo);
		collectCarInfoEntity.setPhotoVinPath(phohoVinPath);
		// collectCarInfoEntity.setCarImgInfo(carImgInfo);
		collectCarInfoEntity.setPhoto_1(photo1);
		collectCarInfoEntity.setPhoto_2(photo2);
		collectCarInfoEntity.setPhoto_3(photo3);
		collectCarInfoEntity.setPhoto_4(photo4);
		collectCarInfoEntity.setPhoto_5(photo5);
		collectCarInfoEntity.setPhoto_6(photo6);
		collectCarInfoEntity.setPhoto_7(photo7);
		collectCarInfoEntity.setPhoto_8(photo8);
		collectCarInfoEntity.setMileage(mileage);
		collectCarInfoEntity.setAttestStatus(attestStatus);
		collectCarInfoEntity.setCheckStatus(checkStatus);
		// collectCarInfoEntity.setCheckImgInfo(checkImgInfo);
		collectCarInfoEntity.setInsertTime(insertTime);
		collectCarInfoEntity.setInsertUserName(insertUserName);
		collectCarInfoEntity.setMarketNo(marketNo);
		collectCarInfoEntity.setCheckPhoto_1(checkPhoto1);
		collectCarInfoEntity.setCheckPhoto_2(checkPhoto2);
		collectCarInfoEntity.setCheckPhoto_3(checkPhoto3);
		collectCarInfoEntity.setCheckPhoto_4(checkPhoto4);
		collectCarInfoEntity.setCheckPhoto_5(checkPhoto5);
		collectCarInfoEntity.setCheckPhoto_6(checkPhoto6);
		collectCarInfoEntity.setCheckPhoto_7(checkPhoto7);
		collectCarInfoEntity.setCheckPhoto_8(checkPhoto8);
		collectCarInfoEntity.setCheckPhoto_9(checkPhoto9);
		collectCarInfoEntity.setCheckPhoto_10(checkPhoto10);
		collectCarInfoEntity.setCheckPhoto_11(checkPhoto11);
		collectCarInfoEntity.setCheckPhoto_12(checkPhoto12);
		collectCarInfoEntity.setCheckPhoto_13(checkPhoto13);
		collectCarInfoEntity.setCheckPhoto_14(checkPhoto14);
		collectCarInfoEntity.setCheckPhoto_15(checkPhoto15);

		// 存放图片绝对地址
		String imgFilePath = TmsConstants.CAR_COLLECTION_PIC_DIRECTORY;
		String imgFileName = TmsConstants.CAR_COLLECTION_PIC_URL;
		String imgDownload = TmsConstants.APP_MQ_IMG_DOWNLOAD;

		// 车架号照片
		String photo = phohoVinPath.substring(phohoVinPath.indexOf(imgDownload));
		ImageUtils.httpDownload(phohoVinPath, imgFilePath.replaceAll(imgFileName, "") + photo);
		// String vinFileName =
		// phohoVinPath.substring(phohoVinPath.lastIndexOf("/") + 1);
		// ImageUtils.httpDownload(phohoVinPath,imgFilePath+vinFileName);
		phohoVinPath = photo;// imgFileName+vinFileName;//保存到数据库的照片路径

		// 车辆照片
		if (photo1 != null && !photo1.isEmpty()) {
			String photo_1 = photo1.substring(photo1.indexOf(imgDownload));
			ImageUtils.httpDownload(photo1, imgFilePath.replaceAll(imgFileName, "") + photo_1);
			photo1 = photo_1;// imgFileName+photo1FileName;//保存到数据库的照片路径
		}
		if (photo2 != null && !photo2.isEmpty()) {
			String photo_2 = photo2.substring(photo2.indexOf(imgDownload));
			ImageUtils.httpDownload(photo2, imgFilePath.replaceAll(imgFileName, "") + photo_2);
			photo2 = photo_2;
		}
		if (photo3 != null && !photo3.isEmpty()) {
			String photo_3 = photo3.substring(photo3.indexOf(imgDownload));
			ImageUtils.httpDownload(photo3, imgFilePath.replaceAll(imgFileName, "") + photo_3);
			photo3 = photo_3;
		}
		if (photo4 != null && !photo4.isEmpty()) {
			String photo_4 = photo4.substring(photo4.indexOf(imgDownload));
			ImageUtils.httpDownload(photo4, imgFilePath.replaceAll(imgFileName, "") + photo_4);
			photo4 = photo_4;
		}
		if (photo5 != null && !photo5.isEmpty()) {
			String photo_5 = photo5.substring(photo5.indexOf(imgDownload));
			ImageUtils.httpDownload(photo5, imgFilePath.replaceAll(imgFileName, "") + photo_5);
			photo5 = photo_5;
		}
		if (photo6 != null && !photo6.isEmpty()) {
			String photo_6 = photo6.substring(photo6.indexOf(imgDownload));
			ImageUtils.httpDownload(photo6, imgFilePath.replaceAll(imgFileName, "") + photo_6);
			photo6 = photo_6;
		}
		if (photo7 != null && !photo7.isEmpty()) {
			String photo_7 = photo7.substring(photo7.indexOf(imgDownload));
			ImageUtils.httpDownload(photo7, imgFilePath.replaceAll(imgFileName, "") + photo_7);
			photo7 = photo_7;
		}
		if (photo8 != null && !photo8.isEmpty()) {
			String photo_8 = photo8.substring(photo8.indexOf(imgDownload));
			ImageUtils.httpDownload(photo8, imgFilePath.replaceAll(imgFileName, "") + photo_8);
			photo8 = photo_8;
		}

		// 查验照片
		if (checkPhoto1 != null && !checkPhoto1.isEmpty()) {
			String checkPhoto_1 = checkPhoto1.substring(checkPhoto1.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto1, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_1);
			checkPhoto1 = checkPhoto_1;// imgFileName+checkPhoto1FileName;//保存到数据库的照片路径
		}
		if (checkPhoto2 != null && !checkPhoto2.isEmpty()) {
			String checkPhoto_2 = checkPhoto2.substring(checkPhoto2.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto2, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_2);
			checkPhoto2 = checkPhoto_2;
		}
		if (checkPhoto3 != null && !checkPhoto3.isEmpty()) {
			String checkPhoto_3 = checkPhoto3.substring(checkPhoto3.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto3, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_3);
			checkPhoto3 = checkPhoto_3;
		}
		if (checkPhoto4 != null && !checkPhoto4.isEmpty()) {
			String checkPhoto_4 = checkPhoto4.substring(checkPhoto4.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto4, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_4);
			checkPhoto4 = checkPhoto_4;
		}
		if (checkPhoto5 != null && !checkPhoto5.isEmpty()) {
			String checkPhoto_5 = checkPhoto5.substring(checkPhoto5.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto5, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_5);
			checkPhoto5 = checkPhoto_5;
		}
		if (checkPhoto6 != null && !checkPhoto6.isEmpty()) {
			String checkPhoto_6 = checkPhoto6.substring(checkPhoto6.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto6, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_6);
			checkPhoto6 = checkPhoto_6;
		}
		if (checkPhoto7 != null && !checkPhoto7.isEmpty()) {
			String checkPhoto_7 = checkPhoto7.substring(checkPhoto7.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto7, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_7);
			checkPhoto7 = checkPhoto_7;
		}
		if (checkPhoto8 != null && !checkPhoto8.isEmpty()) {
			String checkPhoto_8 = checkPhoto8.substring(checkPhoto8.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto8, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_8);
			checkPhoto8 = checkPhoto_8;
		}
		if (checkPhoto9 != null && !checkPhoto9.isEmpty()) {
			String checkPhoto_9 = checkPhoto9.substring(checkPhoto9.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto9, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_9);
			checkPhoto9 = checkPhoto_9;// imgFileName+checkPhoto9FileName;
		}
		if (checkPhoto10 != null && !checkPhoto10.isEmpty()) {
			String checkPhoto_10 = checkPhoto10.substring(checkPhoto10.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto10, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_10);
			checkPhoto10 = checkPhoto_10;
		}
		if (checkPhoto11 != null && !checkPhoto11.isEmpty()) {
			String checkPhoto_11 = checkPhoto11.substring(checkPhoto11.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto11, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_11);
			checkPhoto11 = checkPhoto_11;
		}
		if (checkPhoto12 != null && !checkPhoto12.isEmpty()) {
			String checkPhoto_12 = checkPhoto12.substring(checkPhoto12.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto12, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_12);
			checkPhoto12 = checkPhoto_12;
		}
		if (checkPhoto13 != null && !checkPhoto13.isEmpty()) {
			String checkPhoto_13 = checkPhoto13.substring(checkPhoto13.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto13, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_13);
			checkPhoto13 = checkPhoto_13;
		}
		if (checkPhoto14 != null && !checkPhoto14.isEmpty()) {
			String checkPhoto_14 = checkPhoto14.substring(checkPhoto14.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto14, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_14);
			checkPhoto14 = checkPhoto_14;
		}

		if (checkPhoto15 != null && !checkPhoto15.isEmpty()) {
			String checkPhoto_15 = checkPhoto15.substring(checkPhoto15.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPhoto15, imgFilePath.replaceAll(imgFileName, "") + checkPhoto_15);
			checkPhoto15 = checkPhoto_15;
		}

		if (checkPicImgPath != null && !checkPicImgPath.isEmpty()) {
			String checkPicImgPath_ = checkPicImgPath.substring(checkPicImgPath.indexOf(imgDownload));
			ImageUtils.httpDownload(checkPicImgPath, imgFilePath.replaceAll(imgFileName, "") + checkPicImgPath_);
			checkPicImgPath = checkPicImgPath_;
		}

		/**
		 * 1）使用传入车架号匹对车架号（VIN）后8位 + 车辆库存状态（registerStatus）不为“3：取消；4：存档” +
		 * 传入系统当前时间同插入时间（insertTime）为同一天， 到库存车辆信息表（tms_market_car_info）中搜索
		 */
		MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
		marketCarInfoDto.setVin(vinCode);
		marketCarInfoDto.setInsertTime(Timestamp.valueOf(insertTime));
		CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
				.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
		List<MarketCarInfoDto> marketCarInfoDtoList = collectCarInfoDao
				.findMarketCarInfoListByInsertTime(marketCarInfoDto);
		MarketCarInfoTempDto marketCarInfoTempDto = new MarketCarInfoTempDto();
		String serial = "";
		if (marketCarInfoDtoList.size() == 1) {
			// 更新 库存车辆信息表（tms_market_car_info）
			serial = marketCarInfoDtoList.get(0).getSerial();
//			marketCarInfoDto = marketCarInfoDtoList.get(0);
			marketCarInfoTempDto.setSerial(serial);
			marketCarInfoTempDto.setIsMatch(2);
			marketCarInfoDto.setSerial(serial);
			marketCarInfoDto.setTempLicensePlate(tempLicensePlate);
			if (tag1Skip == 2) {
				marketCarInfoDto.setPhoto_1(photo1);
				marketCarInfoDto.setPhoto_2(photo2);
				marketCarInfoDto.setPhoto_3(photo3);
				marketCarInfoDto.setPhoto_4(photo4);
				marketCarInfoDto.setPhoto_5(photo5);
				marketCarInfoDto.setPhoto_6(photo6);
				marketCarInfoDto.setPhoto_7(photo7);
				marketCarInfoDto.setPhoto_8(photo8);
				marketCarInfoDto.setColor(color);
				marketCarInfoDto.setMileage(mileage);
				marketCarInfoDto.setEntryStatus(4);
			}
			if (tag2Skip == 2){
				marketCarInfoDto.setAttestStatus(attestStatus);
			}
			if (tag1Skip == 2 ){
				collectCarInfoDao.updateMarketCarInfo(marketCarInfoDto);
			} else if(tag1Skip == 1 && tag2Skip==2){
				collectCarInfoDao.updateMarketCarInfoAttestStatus(marketCarInfoDto);
			} else if(tag1Skip == 1 && tag2Skip==1 && StringUtil.isNotBlank(tempLicensePlate)) {
				collectCarInfoDao.updateMarketCarInfoTempLicensePlate(marketCarInfoDto);
			}
			
			// 2、如果传入的车辆检测是否跳过值为“2：正常”，那么进行如下操作：
			if (tag2Skip == 2){
				//1）如果车辆检测状态（attestStatus）的值被修改，并且传入的车辆检测为非“1：未检测、2：放心车“，那么进行如下操作：
				if (attestStatus != 1 && attestStatus != 2) {
					if (collectCarInfoDao.findTroubleCarInfoByVin(vinCode) == 0) {
						//a）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果没有符合条件数据，那么插入 问题车辆信息表（tms_trouble_car_info）
						//# 车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin） 
						//# 问题类型（troubleType）为关联库存车辆信息表（tms_market_car_info）的车辆检测状态（attestStatus）
						//# 插入时间（insertTime）为当前系统时间
						TroubleCarInfoDto entity = new TroubleCarInfoDto();
						entity.setVin(vinCode);
						entity.setTroubleType(attestStatus);
						entity.setRemark("");
						collectCarInfoDao.insertTroubleCarInfo(entity);
						
					} else {
						//b）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果有符合条件数据，那么更新 问题车辆信息表（tms_trouble_car_info）
						//# 问题类型（troubleType）为关联库存车辆信息表（tms_market_car_info）的车辆检测状态（attestStatus）
						//# 插入时间（insertTime）为当前系统时间
						TroubleCarInfoDto entity = new TroubleCarInfoDto();
						entity.setVin(vinCode);
						entity.setTroubleType(attestStatus);
						collectCarInfoDao.updateTroubleCarInfo(entity);
					}
				}

				//2）如果车辆检测状态（attestStatus）的值被修改，并且传入的车辆检测为“2：放心车”，那么进行如下操作：
				//a）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果有符合条件数据，那么删除 问题车辆信息表（tms_trouble_car_info）对应数据
				if (attestStatus == 2) {
					//# 插入时间（insertTime）为当前系统时间
					TroubleCarInfoDto entity = new TroubleCarInfoDto();
					entity.setVin(vinCode);
					collectCarInfoDao.deleteTroubleCarInfo(entity);
				}
			}
			
			//3、如果传入易碎贴编号不为空，那么插入 易碎贴发放记录表（tms_fragileSticker_history）
			//# 易碎贴编号（fragileStickerID）为传入的易碎贴编号
			//# 商户会员ID（memberId）为关联的库存车辆信息表（tms_market_car_info）的商户会员ID（memberId）
			//# 车辆编号（serial）为关联的库存车辆信息表（tms_market_car_info）的车辆编号（serial）
			//# 发放类型（putType）：如果易碎贴编号（tempLicensePlate）修改前为空 ，那么为“1：第一次发帖”，否则为“2：补贴”
			//# 是否收费（isPay）为“2：不收费”
			//# 插入时间（insertTime）和插入用户（insertUserId）为当前系统时间和“1”
			if(StringUtil.isNotBlank(tempLicensePlate)){
				TmsFragileStickerHistoryDto dto = new TmsFragileStickerHistoryDto();
				dto.setIsPay("2");//不收费
				dto.setMemberId(marketCarInfoDtoList.get(0).getMemberId()+"");
				if(StringUtil.isNullOrBlank(marketCarInfoDtoList.get(0).getTempLicensePlate())) dto.setPutType("1");//第一次发帖
				else dto.setPutType("2");
				dto.setSerial(marketCarInfoDtoList.get(0).getSerial());
				dto.setFragileStickerId(tempLicensePlate);
				dto.setInsertUserId(1);
				collectCarInfoDao.insertFragileStickerHistory(dto);
			}
			
		}

		if (marketCarInfoDtoList.size() == 0) {
			/**
			 * b）如果没有符合条件的数据，那么重新调整搜索条件： 使用传入车架号匹对车架号（VIN）后8位 +
			 * 车辆库存状态（registerStatus）不为“3：取消；4：存档”，
			 * 到库存车辆信息表（tms_market_car_info）中搜索
			 */

			List<MarketCarInfoDto> marketCarInfoDtoListNoInsert = collectCarInfoDao
					.findMarketCarInfoList(marketCarInfoDto);
			if (marketCarInfoDtoListNoInsert.size() == 1) {
				// 更新 库存车辆信息表（tms_market_car_info）
				serial = marketCarInfoDtoListNoInsert.get(0).getSerial();
//				marketCarInfoDto = marketCarInfoDtoListNoInsert.get(0);
				marketCarInfoTempDto.setSerial(serial);
				marketCarInfoTempDto.setIsMatch(2);
				marketCarInfoDto.setSerial(serial);
				marketCarInfoDto.setTempLicensePlate(marketCarInfoDto.getTempLicensePlate());
				if (tag1Skip == 2) {
					marketCarInfoDto.setPhoto_1(photo1);
					marketCarInfoDto.setPhoto_2(photo2);
					marketCarInfoDto.setPhoto_3(photo3);
					marketCarInfoDto.setPhoto_4(photo4);
					marketCarInfoDto.setPhoto_5(photo5);
					marketCarInfoDto.setPhoto_6(photo6);
					marketCarInfoDto.setPhoto_7(photo7);
					marketCarInfoDto.setPhoto_8(photo8);
					marketCarInfoDto.setColor(color);
					marketCarInfoDto.setMileage(mileage);
					marketCarInfoDto.setEntryStatus(4);
				}
				if (tag2Skip == 2){
					marketCarInfoDto.setAttestStatus(attestStatus);
				}
				if (tag1Skip == 2 ){
					collectCarInfoDao.updateMarketCarInfo(marketCarInfoDto);
				} else if(tag1Skip == 1 && tag2Skip==2){
					collectCarInfoDao.updateMarketCarInfoAttestStatus(marketCarInfoDto);
				} else if(tag1Skip == 1 && tag2Skip==1 && StringUtil.isNotBlank(tempLicensePlate)) {
					collectCarInfoDao.updateMarketCarInfoTempLicensePlate(marketCarInfoDto);
				}
				
				// 2、如果传入的车辆检测是否跳过值为“2：正常”，那么进行如下操作：
				if (tag2Skip == 2){
					//1）如果车辆检测状态（attestStatus）的值被修改，并且传入的车辆检测为非“1：未检测、2：放心车“，那么进行如下操作：
					if (attestStatus != 1 && attestStatus != 2) {
						if (collectCarInfoDao.findTroubleCarInfoByVin(vinCode) == 0) {
							//a）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果没有符合条件数据，那么插入 问题车辆信息表（tms_trouble_car_info）
							//# 车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin） 
							//# 问题类型（troubleType）为关联库存车辆信息表（tms_market_car_info）的车辆检测状态（attestStatus）
							//# 插入时间（insertTime）为当前系统时间
							TroubleCarInfoDto entity = new TroubleCarInfoDto();
							entity.setVin(vinCode);
							entity.setTroubleType(attestStatus);
							entity.setRemark("");
							collectCarInfoDao.insertTroubleCarInfo(entity);
							
						} else {
							//b）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果有符合条件数据，那么更新 问题车辆信息表（tms_trouble_car_info）
							//# 问题类型（troubleType）为关联库存车辆信息表（tms_market_car_info）的车辆检测状态（attestStatus）
							//# 插入时间（insertTime）为当前系统时间
							TroubleCarInfoDto entity = new TroubleCarInfoDto();
							entity.setVin(vinCode);
							entity.setTroubleType(attestStatus);
							collectCarInfoDao.updateTroubleCarInfo(entity);
						}
					}

					//2）如果车辆检测状态（attestStatus）的值被修改，并且传入的车辆检测为“2：放心车”，那么进行如下操作：
					//a）通过车架号（vin）为关联库存车辆信息表（tms_market_car_info）的车架号（vin）到问题车辆信息表（tms_trouble_car_info）进行查询，如果有符合条件数据，那么删除 问题车辆信息表（tms_trouble_car_info）对应数据
					if (attestStatus == 2) {
						//# 插入时间（insertTime）为当前系统时间
						TroubleCarInfoDto entity = new TroubleCarInfoDto();
						entity.setVin(vinCode);
						collectCarInfoDao.deleteTroubleCarInfo(entity);
					}
				}
				
				//3、如果传入易碎贴编号不为空，那么插入 易碎贴发放记录表（tms_fragileSticker_history）
				//# 易碎贴编号（fragileStickerID）为传入的易碎贴编号
				//# 商户会员ID（memberId）为关联的库存车辆信息表（tms_market_car_info）的商户会员ID（memberId）
				//# 车辆编号（serial）为关联的库存车辆信息表（tms_market_car_info）的车辆编号（serial）
				//# 发放类型（putType）：如果易碎贴编号（tempLicensePlate）修改前为空 ，那么为“1：第一次发帖”，否则为“2：补贴”
				//# 是否收费（isPay）为“2：不收费”
				//# 插入时间（insertTime）和插入用户（insertUserId）为当前系统时间和“1”
				if(StringUtil.isNotBlank(tempLicensePlate)){
					TmsFragileStickerHistoryDto dto = new TmsFragileStickerHistoryDto();
					dto.setIsPay("2");//不收费
					dto.setMemberId(marketCarInfoDtoListNoInsert.get(0).getMemberId()+"");
					if(StringUtil.isNullOrBlank(marketCarInfoDtoListNoInsert.get(0).getTempLicensePlate())) dto.setPutType("1");//第一次发帖
					else dto.setPutType("2");
					dto.setSerial(marketCarInfoDtoListNoInsert.get(0).getSerial());
					dto.setFragileStickerId(tempLicensePlate);
					dto.setInsertUserId(1);
					collectCarInfoDao.insertFragileStickerHistory(dto);
				}
			}
		}

		if (serial != null && !serial.isEmpty()) {
			int countService = collectCarInfoDao.findMarketCarInfoServiceBySerial(serial);
			if (countService != 0) {
				// 更新 库存车辆业务表（tms_market_car_service）
				MarketCarServiceDto marketCarServiceDto = new MarketCarServiceDto();
				marketCarServiceDto.setSerial(serial);// 车辆编号
				marketCarServiceDto.setCheckStatus(checkStatus);// 车辆查验状态

				int isValid = 2;
				if (checkStatus == 2) {
					marketCarServiceDto.setCheckImgPath(checkPicImgPath);// 查验单照片
					marketCarServiceDto.setCheckUser(insertUserName);// 查验员
					marketCarServiceDto.setCheckTime(Timestamp.valueOf(insertTime));// 查验时间
					// 2017.03.22 邮件变更 # 如果传入的车辆查验为“2：已查验”，那么值为当前系统时间+1个月；否则为空
					// 原内容 ：# 查验有效时间（checkValidTime）为空
					marketCarServiceDto.setCheckValidTime(Timestamp.valueOf(DateUtil.getMonthTime(1))); // 那么值为当前系统时间+1个月
					isValid = 2;
				} else {
					marketCarServiceDto.setCheckImgPath(null);// 查验单照片
					marketCarServiceDto.setCheckUser(null);// 查验员
					marketCarServiceDto.setCheckTime(null);// 查验时间
					marketCarServiceDto.setCheckValidTime(null); // 查验有效时间（checkValidTime）为空
					isValid = 3;
				}
				marketCarServiceDto.setIsValid(isValid);// 查验是否有效
				if (tag3Skip == 2)
					collectCarInfoDao.updateMarketCarService(marketCarServiceDto);
			} else if (countService == 0) {
				MarketCarServiceDto marketCarServiceDto = new MarketCarServiceDto();
				marketCarServiceDto.setSerial(serial);// 车辆编号
				marketCarServiceDto.setCheckStatus(checkStatus);// 车辆查验状态
				int isValid = 2;
				if (checkStatus == 2) {
					marketCarServiceDto.setCheckImgPath(checkPicImgPath);// 查验单照片
					marketCarServiceDto.setCheckUser(insertUserName);// 查验员
					marketCarServiceDto.setCheckTime(Timestamp.valueOf(insertTime));// 查验时间
					isValid = 2;
				} else {
					marketCarServiceDto.setCheckImgPath(null);// 查验单照片
					marketCarServiceDto.setCheckUser(null);// 查验员
					marketCarServiceDto.setCheckTime(null);// 查验时间
					isValid = 3;
				}
				marketCarServiceDto.setIsValid(isValid);// 查验是否有效
				collectCarInfoDao.insertMarketCarInfoService(marketCarServiceDto);
			}
		}

		try {
			// 插入 库存车辆信息采集表（tmsapp_market_car_info_temp）
			marketCarInfoTempDto.setIsMatch("".equals(serial) ? 1 : 2);
			marketCarInfoTempDto.setVin(vinCode);
			marketCarInfoTempDto.setVinPhoto(phohoVinPath);
			marketCarInfoTempDto.setTag1Skip(tag1Skip);
			marketCarInfoTempDto.setTag2Skip(tag2Skip);
			marketCarInfoTempDto.setTag3Skip(tag3Skip);
			marketCarInfoTempDto.setTempLicensePlate(tempLicensePlate);
			if (tag1Skip == 2) {
				marketCarInfoTempDto.setPhoto1(photo1);
				marketCarInfoTempDto.setPhoto2(photo2);
				marketCarInfoTempDto.setPhoto3(photo3);
				marketCarInfoTempDto.setPhoto4(photo4);
				marketCarInfoTempDto.setPhoto5(photo5);
				marketCarInfoTempDto.setPhoto6(photo6);
				marketCarInfoTempDto.setPhoto7(photo7);
				marketCarInfoTempDto.setPhoto8(photo8);
				marketCarInfoTempDto.setMileage(mileage);
				marketCarInfoTempDto.setColor(color);
			}
			if (tag2Skip == 2) {
				marketCarInfoTempDto.setAttestStatus(attestStatus);
				marketCarInfoTempDto.setCheckPhoto_1(checkPhoto1);
				marketCarInfoTempDto.setCheckPhoto_2(checkPhoto2);
				marketCarInfoTempDto.setCheckPhoto_3(checkPhoto3);
				marketCarInfoTempDto.setCheckPhoto_4(checkPhoto4);
				marketCarInfoTempDto.setCheckPhoto_5(checkPhoto5);
				marketCarInfoTempDto.setCheckPhoto_6(checkPhoto6);
				marketCarInfoTempDto.setCheckPhoto_7(checkPhoto7);
				marketCarInfoTempDto.setCheckPhoto_8(checkPhoto8);
				marketCarInfoTempDto.setCheckPhoto_9(checkPhoto9);
				marketCarInfoTempDto.setCheckPhoto_10(checkPhoto10);
				marketCarInfoTempDto.setCheckPhoto_11(checkPhoto11);
				marketCarInfoTempDto.setCheckPhoto_12(checkPhoto12);
				marketCarInfoTempDto.setCheckPhoto_13(checkPhoto13);
				marketCarInfoTempDto.setCheckPhoto_14(checkPhoto14);
				marketCarInfoTempDto.setCheckPhoto_15(checkPhoto15);
			}
			if (tag3Skip == 2) {
				marketCarInfoTempDto.setCheckStatus(checkStatus);
				marketCarInfoTempDto.setCheckImgPath(checkPicImgPath);
			}
			marketCarInfoTempDto.setInsertUser(insertUserName);
			marketCarInfoTempDto.setInsertTime(Timestamp.valueOf(insertTime));
			collectCarInfoDao.insertMarketCarInfoTemp(marketCarInfoTempDto);
		} catch (TmsDaoException e) {
			e.printStackTrace();
		}

		// 同步到微信端
		if (serial != null && !serial.isEmpty()) {
			CollectCarInfoBo collectCarInfoBo = new CollectCarInfoBo();
			collectCarInfoBo.setSerial(serial);
			if (tag1Skip == 2) {
				collectCarInfoBo.setMileage(mileage);
				collectCarInfoBo.setPhoto_1(photo1);
				collectCarInfoBo.setPhoto_2(photo2);
				collectCarInfoBo.setPhoto_3(photo3);
				collectCarInfoBo.setPhoto_4(photo4);
				collectCarInfoBo.setPhoto_5(photo5);
				collectCarInfoBo.setPhoto_6(photo6);
				collectCarInfoBo.setPhoto_7(photo7);
				collectCarInfoBo.setPhoto_8(photo8);
				collectCarInfoBo.setColor(color);
			}
			if (tag2Skip == 2)
				collectCarInfoBo.setAttestStatus(attestStatus);
			// 获得市场编号
			TmsConfigureDaoimp tmsConfigureDao = (TmsConfigureDaoimp) TmsConfigureDaoimp.getInstance(TmsDao.TMS_CONFIGURE);
			String userMarket = tmsConfigureDao.getConfig("maketNo");
			collectCarInfoBo.setMarketNo(Integer.parseInt(userMarket));
			collectCarInfoBo.setEntryStatus(4);
			WeChatMqApi.getInstance().call(collectCarInfoBo);
		}

	}

	/**
	 * 库存登记203接口
	 * 
	 * @param stockRegisterCarInfo
	 * 
	 * @throws TmsDaoException
	 */
	public void executeStockRegisterCarInfo(StockRegisterCarInfo stockRegisterCarInfo) throws TmsDaoException {
		// 1）车辆编号存在check：到对应的库存车辆信息表（tms_market_car_info）中，搜索车辆编号（serial）为传入车辆编号，如果信息存在，那么进行如下操作：
		Car car = Car.getInstance();
		car = car.findCarBySerial(stockRegisterCarInfo.getSerial());
		CarDao carDao = (CarDao) TmsDao.getInstance(TmsDao.TMS_CAR);
		MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
		// 车架号、
		marketCarInfoDto.setVin(stockRegisterCarInfo.getVin());
		// 车牌号码
		marketCarInfoDto.setLicensePlate(stockRegisterCarInfo.getLicensePlate());
		// 商户会员id、
		marketCarInfoDto.setMemberId(Integer.valueOf(stockRegisterCarInfo.getMemberId()));
		// 车辆种类、
		marketCarInfoDto.setCatClass(Integer.valueOf(stockRegisterCarInfo.getCatClass()));
		// 品牌id、
		marketCarInfoDto.setVendorId(stockRegisterCarInfo.getVendorId());
		// 车系id、
		marketCarInfoDto.setBrandId(stockRegisterCarInfo.getBrandId());
		// 款式id、
		marketCarInfoDto.setCarStyleId(stockRegisterCarInfo.getCarStyleId());
		// 表显里程、
		marketCarInfoDto.setMileage(Integer.valueOf(stockRegisterCarInfo.getMileage()));
		// 预售价格、
		marketCarInfoDto.setPrice(stockRegisterCarInfo.getPrice());
		marketCarInfoDto.setColor(stockRegisterCarInfo.getColor());
		;// 颜色
		marketCarInfoDto.setRegDate(stockRegisterCarInfo.getRegDate());
		;// 登记日期
		marketCarInfoDto.setJqx(stockRegisterCarInfo.getJqx());// 交强险日期
		marketCarInfoDto.setYearCarefulPeriod(stockRegisterCarInfo.getYearCarefulPeriod());
		;// 年检日期
		marketCarInfoDto.setCompanyContactPerson(stockRegisterCarInfo.getContactPerson());// 联系人
		marketCarInfoDto.setCompanyContactPhone(stockRegisterCarInfo.getContactPhone());
		;// 联系人电话
		marketCarInfoDto.setRemark(stockRegisterCarInfo.getAttrIntro());
		// marketCarInfoDto.seattrIntro;//配置说明（展售说明）

		// 存放图片绝对地址
		String imgFilePath = TmsConstants.CAR_COLLECTION_PIC_DIRECTORY;
		String imgFileName = TmsConstants.CAR_COLLECTION_PIC_URL;
		String imgDownload = TmsConstants.APP_MQ_IMG_DOWNLOAD;

		String photo1 = stockRegisterCarInfo.getPhoto1();
		if (!StringUtil.isNullOrBlank(photo1)) {
			String photo_1 = photo1.substring(photo1.indexOf(imgDownload));
			ImageUtils.httpDownload(photo1, imgFilePath.replaceAll(imgFileName, "") + photo_1);
			marketCarInfoDto.setPhoto_1(photo_1);// 车辆照片1
		}
		String photo2 = stockRegisterCarInfo.getPhoto2();
		if (!StringUtil.isNullOrBlank(photo2)) {
			String photo_2 = photo2.substring(photo2.indexOf(imgDownload));
			ImageUtils.httpDownload(photo2, imgFilePath.replaceAll(imgFileName, "") + photo_2);
			marketCarInfoDto.setPhoto_2(photo_2);// 车辆照片2
		}
		String photo3 = stockRegisterCarInfo.getPhoto3();
		if (!StringUtil.isNullOrBlank(photo3)) {
			String photo_3 = photo3.substring(photo3.indexOf(imgDownload));
			ImageUtils.httpDownload(photo3, imgFilePath.replaceAll(imgFileName, "") + photo_3);
			marketCarInfoDto.setPhoto_3(photo_3);// 车辆照片3
		}
		String photo4 = stockRegisterCarInfo.getPhoto4();
		if (!StringUtil.isNullOrBlank(photo4)) {
			String photo_4 = photo4.substring(photo4.indexOf(imgDownload));
			ImageUtils.httpDownload(photo4, imgFilePath.replaceAll(imgFileName, "") + photo_4);
			marketCarInfoDto.setPhoto_4(photo_4);// 车辆照片4
		}
		String photo5 = stockRegisterCarInfo.getPhoto5();
		if (!StringUtil.isNullOrBlank(photo5)) {
			String photo_5 = photo5.substring(photo5.indexOf(imgDownload));
			ImageUtils.httpDownload(photo5, imgFilePath.replaceAll(imgFileName, "") + photo_5);
			marketCarInfoDto.setPhoto_5(photo_5);// 车辆照片5
		}
		String photo6 = stockRegisterCarInfo.getPhoto6();
		if (!StringUtil.isNullOrBlank(photo6)) {
			String photo_6 = photo6.substring(photo6.indexOf(imgDownload));
			ImageUtils.httpDownload(photo6, imgFilePath.replaceAll(imgFileName, "") + photo_6);
			marketCarInfoDto.setPhoto_6(photo_6);// 车辆照片6
		}
		String photo7 = stockRegisterCarInfo.getPhoto7();
		if (!StringUtil.isNullOrBlank(photo7)) {
			String photo_7 = photo7.substring(photo7.indexOf(imgDownload));
			ImageUtils.httpDownload(photo7, imgFilePath.replaceAll(imgFileName, "") + photo_7);
			marketCarInfoDto.setPhoto_7(photo_7);// 车辆照片7
		}
		String photo8 = stockRegisterCarInfo.getPhoto8();
		if (!StringUtil.isNullOrBlank(photo8)) {
			String photo_8 = photo8.substring(photo8.indexOf(imgDownload));
			ImageUtils.httpDownload(photo8, imgFilePath.replaceAll(imgFileName, "") + photo_8);
			marketCarInfoDto.setPhoto_8(photo_8);// 车辆照片8
		}
		marketCarInfoDto.setIsMatch(stockRegisterCarInfo.getIsMatch());
		;// 车款是否配对
		marketCarInfoDto.setCarName(stockRegisterCarInfo.getCarName());
		;// 车辆名称
		marketCarInfoDto.setIsShelve(stockRegisterCarInfo.getIsShelve());
		;// 是否上架
		marketCarInfoDto.setRegisterStatus(stockRegisterCarInfo.getRegisterStatus());
		;// 车辆库存状态
		marketCarInfoDto.setAttestStatus(stockRegisterCarInfo.getAttestStatus());
		;// 车辆认证状态
		marketCarInfoDto.setEntryStatus(stockRegisterCarInfo.getEntryStatus());
		;// 车辆录入状态
		marketCarInfoDto.setBarCodeNum(stockRegisterCarInfo.getBarCodeNum());
		;// 车辆挂起状态
		marketCarInfoDto.setInsertUserId(1);
		marketCarInfoDto.setSerial(stockRegisterCarInfo.getSerial());
		int cid = car.getcId();
		if (cid != 0) {
			carDao.updateMarketCarInfo(marketCarInfoDto);
		} else if (cid == 0) {
			carDao.saveMarketCarInfo(marketCarInfoDto);
		}
		MarketCarServiceDao carServiceDao = (MarketCarServiceDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_SERVICE_INFO);
		MarketCarServiceDto carServiceInfo = carServiceDao.findCarServiceInfoBySerial(stockRegisterCarInfo.getSerial());

		MarketCarServiceDto carServiceInfoParam = new MarketCarServiceDto();
		carServiceInfoParam.setSerial(stockRegisterCarInfo.getSerial());

		carServiceInfoParam.setIsValid(3);
		carServiceInfoParam.setCheckStatus(1);
		carServiceInfoParam.setCheckPrice(stockRegisterCarInfo.getIsAmount() == 1 ? 1 : 0);
		carServiceInfoParam
				.setTransferPrice(stockRegisterCarInfo.getIsAmount() == 1 ? stockRegisterCarInfo.getChangePrice() : 0);
		carServiceInfoParam.setIsRebate(stockRegisterCarInfo.getIsAmount() == 1 ? 2 : 0);
		if (carServiceInfo != null) {
			carServiceDao.updateCarServiceInfoNew(carServiceInfo);
		} else {
			carServiceDao.insertCarServiceInfo(carServiceInfoParam);
		}

		// 2、如果传入的是否缴费为“1：缴费”，那么进行如下处理
		if (stockRegisterCarInfo.getIsAmount() == 1) {
			// 更新 会员基本信息数据表（tms_member）
			// 过户费余额（virtualMargin） = 过户费余额（virtualMargin） - 传入的缴费金额
			car.updateMember(Integer.valueOf(stockRegisterCarInfo.getMemberId()), stockRegisterCarInfo.getPrice() * -1);
			// b）插入 财务流水记录表（tms_integral_register）
			IntegralRegister register = new IntegralRegister();
			// # 会员编号（memberId）为传入的商户会员ID
			register.setMemberId(String.valueOf(stockRegisterCarInfo.getMemberId()));
			// # 会员类型（memberType）为”1：商户会员“
			register.setMemberType(1);
			// # 业务处理类型（chargeType）为“12：过户费缴费”
			register.setChargeType(12);
			// # 处理金额（transferPrice）为传入的缴费金额
			register.setTransferPrice(stockRegisterCarInfo.getCheckPrice());
			// # 业务处理方式（plusMinus）为“2、减少”
			register.setPlusMinus(2);
			// # 备注（remarks）为传入的财务流水备注
			register.setRemark(stockRegisterCarInfo.getRemarks());
			// # 插入用户（insertUserId）为“1”
			register.setInsertUserId(1);
			register.setSerial(stockRegisterCarInfo.getSerial());
			// 插入 财务流水记录表（tms_integral_register）
			register.insertRegisterInfo(register);
		}

		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		MarketCarHandleDto marketCarHandleDto = new MarketCarHandleDto();
		marketCarHandleDto.setSerial(stockRegisterCarInfo.getSerial());
		marketCarHandleDto.setHandleType(cid == 0 ? 13 : 14);
		marketCarHandleDto.setIsPush(2);
		marketCarHandleDto.setPushContent(stockRegisterCarInfo.getOperator() + "通过手机终端进行库存登记，同时系统自动扣除库存登记预缴费用"
				+ stockRegisterCarInfo.getPrice() + "元");
		marketCarHandleDto.setPhoto("");
		marketCarHandleDto.setUpdateUserId(1);
		marketCarHandleDto.setUpdateTime(new Timestamp(new Date().getTime()));
		marketCarHandleInfoDao.insertCarHandleInfo(marketCarHandleDto);

	}

	/**
	 * 接口编号：204；【TMS_app】车辆换牌=》【TMS_web】同步
	 * 
	 * @param transferDataSyn000204
	 */
	public void executeTransferDataSyn000204(TransferDataSyn000204 transferDataSyn000204) throws TmsDaoException {
		CarDao carDao = (CarDao) TmsDao.getInstance(TmsDao.TMS_CAR);
		MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
		marketCarInfoDto.setSerial(transferDataSyn000204.getSerial());
		marketCarInfoDto.setLicensePlate(transferDataSyn000204.getLicensePlate());
		carDao.updateMarketCarInfoFor204(marketCarInfoDto);

		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		// MarketCarHandleInfo carHandleInfo = new MarketCarHandleInfo();
		MarketCarHandleDto carHandleInfo = new MarketCarHandleDto();
		carHandleInfo.setSerial(transferDataSyn000204.getSerial());
		carHandleInfo.setHandleType(10);
		carHandleInfo.setIsPush(2);
		carHandleInfo.setPushContent(null);
		carHandleInfo.setUpdateUserId(1);
		// marketCarHandleInfoDao.updateCarHandleInfo(carHandleInfo);

		marketCarHandleInfoDao.insertCarHandleInfo(carHandleInfo);

	}

	/**
	 * 接口编号：205；【TMS_app】车架号修改=》【TMS_web】同步
	 * 
	 * @param transferVinDataSyn000205
	 */
	public void executeTransferVinDataSyn000205(TransferVinDataSyn000205 transferVinDataSyn000205)
			throws TmsDaoException {
		CarDao carDao = (CarDao) TmsDao.getInstance(TmsDao.TMS_CAR);
		MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
		marketCarInfoDto.setSerial(transferVinDataSyn000205.getSerial());
		marketCarInfoDto.setVin(transferVinDataSyn000205.getVin());
		carDao.updateMarketCarInfoFor205(marketCarInfoDto);
	}

	/**
	 * 接口编号：206；【TMS_app】库存取消=》【TMS_web】同步
	 * 
	 * @param transferStockQXDataSyn000206
	 *
	 * 
	 *            "todo
	 *            5、通过API接口将信息传送给微信平台，具体请参照TMS平台同步接口（需求说明本_tms_web.xlsx/微信平台同步接口/库存同步的接口编号：205），具体参数如下
	 *            ： #todo 市场编号到系统功能配置表（tms_configure），取参数名为maketNo的对应参数值 #todo
	 *            车辆编号、商户会员ID、车辆库存状态为关联库存车辆信息表（tms_market_car_info）的车辆编号（serial）、商户会员ID（memberId）、车辆库存状态（registerStatus）
	 *            #todo 是否推送为“2：不推送” #todo 推送内容为空 #todo
	 *            进行退费处理情况，是否缴费为”1：是“、缴费金额和财务流水备注为业务插入到财务流水记录表（tms_integral_register）的处理金额（transferPrice）和备注（remarks）；否则是否缴费为”2：不是“、缴费金额和财务流水备注为空"
	 */
	public void executeTransferStockQXDataSyn000206(TransferStockQXDataSyn000206 transferStockQXDataSyn000206)
			throws TmsDaoException {
		CarDao carDao = (CarDao) TmsDao.getInstance(TmsDao.TMS_CAR);
		MarketCarInfoDto marketCarInfoDto = new MarketCarInfoDto();
		marketCarInfoDto.setSerial(transferStockQXDataSyn000206.getSerial());
		marketCarInfoDto.setRegisterStatus(3);
		carDao.updateMarketCarInfoFor206(marketCarInfoDto);
		// tms_market_car_service
		MarketCarServiceDao carServiceDao = (MarketCarServiceDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_SERVICE_INFO);
		MarketCarServiceDto carServiceInfo = carServiceDao
				.findCarServiceInfoBySerial(transferStockQXDataSyn000206.getSerial());
		if (carServiceInfo != null && carServiceInfo.getCheckPrice() == 1) {
			MemberDao memberDao = (MemberDao) TmsDao.getInstance(TmsDao.TMS_MEMBER);
			MemberDto memberInfo = memberDao.findMemberInfoByMemId(transferStockQXDataSyn000206.getMemberId());
			memberDao.updateMemberVirtualMargin(transferStockQXDataSyn000206.getMemberId(),
					memberInfo.getVirtualMargin() + carServiceInfo.getTransferPrice());

			// 插入 财务流水记录表
			IntegralRegister integralRegister = new IntegralRegister();
			integralRegister.setMemberId(transferStockQXDataSyn000206.getMemberId());
			integralRegister.setMemberType(1);
			integralRegister.setChargeType(11);
			integralRegister.setTransferPrice(carServiceInfo.getTransferPrice());
			integralRegister.setPlusMinus(1);
			integralRegister.setRemark("库存登记预缴交易过户费退费");
//			integralRegister.setUpdateTime(new Timestamp(new Date().getTime()));
//			integralRegister.setUpdateUserId(1);
			integralRegister.setInsertTime(new Timestamp(new Date().getTime()));
			integralRegister.setInsertUserId(1);
			integralRegister.insertRegisterInfo(integralRegister);
		}
		// 更新 库存车辆业务表（tms_market_car_service）
		MarketCarServiceDto carServiceDtoUpdate = new MarketCarServiceDto();
		carServiceDtoUpdate.setSerial(transferStockQXDataSyn000206.getSerial());
		carServiceDtoUpdate.setCheckStatus(1);
		carServiceDtoUpdate.setCheckImgPath(null);
		carServiceDtoUpdate.setCheckUser(null);
		carServiceDtoUpdate.setCheckTime(null);
		carServiceDtoUpdate.setCheckValidTime(null);
		carServiceDtoUpdate.setIsValid(3);
		carServiceDtoUpdate.setCheckPrice(0);
		carServiceDtoUpdate.setTransferPrice(0);
		carServiceDtoUpdate.setIsRebate(0);
		carServiceDao.updateCarServiceInfo(carServiceDtoUpdate);

		// 插入库存车辆特殊处理记录表（tms_market_car_handleInfo）
		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		// MarketCarHandleInfo carHandleInfo = new MarketCarHandleInfo();
		MarketCarHandleDto carHandleInfo = new MarketCarHandleDto();
		carHandleInfo.setSerial(transferStockQXDataSyn000206.getSerial());
		carHandleInfo.setHandleType(3);
		carHandleInfo.setIsPush(2);
		//TODO 修改成用户名字的测试
		carHandleInfo.setPushContent(transferStockQXDataSyn000206.getUserName() + "通过手机终端进行库存取消");
		carHandleInfo.setUpdateUserId(1);
		carHandleInfo.setUpdateTime(new Timestamp(new Date().getTime()));
		// marketCarHandleInfoDao.updateCarHandleInfo(carHandleInfo);
		marketCarHandleInfoDao.insertCarHandleInfo(carHandleInfo);

		// 接口编号：205；【TMS_web】库存取消 =>【TMS_app】同步
		TransferDataSyn000205Bo transferDataSyn000205Bo = new TransferDataSyn000205Bo();
		Car carInfo = Car.getInstance();

		carInfo = carInfo.findMemberId(transferStockQXDataSyn000206.getSerial());
		transferDataSyn000205Bo.setSerial(carInfo.getSerial());
		transferDataSyn000205Bo.setMemberId(String.valueOf(carInfo.getMemberId()));
		transferDataSyn000205Bo.setRegisterStatus(carInfo.getRegisterStatus());
		transferDataSyn000205Bo.setPushFlag(2);
		transferDataSyn000205Bo.setPushText("");
		transferDataSyn000205Bo.setMarketNo(TmsConstants.MARKET_NO);

		// #
		// 库存取消业务并且进行退费处理情况，是否缴费为”1：是“、缴费金额和财务流水备注为业务插入到财务流水记录表（tms_integral_register）的处理金额（transferPrice）和备注（remarks）
		if (carServiceInfo != null && carServiceInfo.getCheckPrice() == 1) {
			// 是否缴费、缴费金额、财务流水备注[（transferPrice）和备注（remarks）]
			transferDataSyn000205Bo.setIdTollage(1);
			transferDataSyn000205Bo.setTransferPrice(carServiceInfo.getTransferPrice());
			transferDataSyn000205Bo.setRemarks("库存登记预缴交易过户费退费");
		}
		// # 库存取消业务并且没有进行退费处理情况，或者 库存信息过滤业务情况，是否缴费为”2：不是“、缴费金额和财务流水备注为空
		else {
			transferDataSyn000205Bo.setIdTollage(2);
			transferDataSyn000205Bo.setTransferPrice(0);
			transferDataSyn000205Bo.setRemarks("");
		}
		WeChatMqApi.getInstance().call(transferDataSyn000205Bo);
	}

	/**
	 * 接口编号：207；【TMS_app】车辆移库=》【TMS_web】同步
	 * 
	 * @param transferDataSyn000207
	 */
	public void executeTransferDataSyn000207(TransferDataSyn000207 transferDataSyn000207) throws TmsDaoException {

		// 1）更新库存车辆信息表（tms_market_car_info）
		// # 商户会员ID（memberId）为传入的迁移到商户会员ID
		// # 更新时间（updateTime）和更新用户（updateUserId）都不进行更新
		Member member = Member.getInstance();
		Car car = Car.getInstance();
		car = car.findCarBySerial(transferDataSyn000207.getSerial());

		// 迁移前商户会员
		int updateBeforeMemberId = car.getMemberId();
		car.setSerial(transferDataSyn000207.getSerial());
		car.setMemberId(Integer.parseInt(transferDataSyn000207.getMemberId()));
		
		member = member.getMember(transferDataSyn000207.getMemberId());
		car.setCompanyContactPerson(member.getContactOwner());
		car.setCompanyContactPhone(member.getContactPhone());
		car.updateMarketCarInfo(car);

		// 2）更新商户会员信息数据表（tms_member），如果车辆的库存状态为“1：已入库”，那么更新迁移前商户会员的信息
		// # 当前库存量（usedCarPort） = 当前库存量 - 1
		
		if (car.getRegisterStatus() == 1) {
			member = member.getMember(String.valueOf(updateBeforeMemberId));
			member.updateUsedCarPort(updateBeforeMemberId, member.getUsedCarPort(), -1,"ConsumerService");
		}

		// 3）更新商户会员信息数据表（tms_member），如果当前车辆的库存状态为“1：已入库”，那么更新迁移到商户会员的信息
		// # 当前库存量（usedCarPort） = 当前库存量 + 1
		if (car.getRegisterStatus() == 1) {
			member = member.getMember(transferDataSyn000207.getMemberId());
			member.updateUsedCarPort(Integer.parseInt(transferDataSyn000207.getMemberId()), member.getUsedCarPort(), 1,"ConsumerService");
		}

		// 4）插入库存车辆特殊处理记录表（tms_market_car_handleInfo），迁移前商户会员推送信息保存处理
		// # 车辆编号（serial）为当前车辆编号
		// # 操作类型（handleType）为“6：库存移出”
		// # 是否推送（isPush）为“1：推送”
		// # 推送内容（pushContent）为传入的迁移前商户微信推送内容
		// # 更新用户ID（updateUserId）为“1”
		// # 更新时间（updateTime）为当前系统时间
		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao
				.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		// MarketCarHandleInfo carHandleInfo = new MarketCarHandleInfo();
		MarketCarHandleDto carHandleInfo = new MarketCarHandleDto();
		carHandleInfo.setSerial(transferDataSyn000207.getSerial());
		carHandleInfo.setHandleType(6);
		carHandleInfo.setIsPush(1);
		carHandleInfo.setPushContent(transferDataSyn000207.getPushText1());
		carHandleInfo.setUpdateUserId(1);
		marketCarHandleInfoDao.insertCarHandleInfo(carHandleInfo);

		// 5）插入 库存车辆特殊处理记录表（tms_market_car_handleInfo），迁移到商户会员推送信息保存处理
		// # 车辆编号（serial）为当前车辆编号
		// # 操作类型（handleType）为“5：库存移入”
		// # 是否推送（isPush）为“1：推送”
		// # 推送内容（pushContent）为传入的迁移到商户微信推送内容
		// # 更新用户ID（updateUserId）为“1”
		// # 更新时间（updateTime）为当前系统时间
		carHandleInfo.setSerial(transferDataSyn000207.getSerial());
		carHandleInfo.setHandleType(5);
		carHandleInfo.setIsPush(1);
		carHandleInfo.setPushContent(transferDataSyn000207.getPushText2());
		carHandleInfo.setUpdateUserId(1);

		marketCarHandleInfoDao.insertCarHandleInfo(carHandleInfo);
	}
	public static void main(String[] s) {
		// 存放图片绝对地址
		String photo1 = "/localweb/app/tianqu/tms/web/image/11/2018/1/201893202915821Qq7WJ.jpg";
		String imgFilePath = TmsConstants.CAR_COLLECTION_PIC_DIRECTORY;
		String imgFileName = TmsConstants.CAR_COLLECTION_PIC_URL;
		String imgDownload = TmsConstants.APP_MQ_IMG_DOWNLOAD;
		String photo_1 = photo1.substring(photo1.indexOf(imgDownload));
		System.out.println(photo_1);
		System.out.println(imgFilePath.replaceAll(imgFileName, "") + photo_1);
	}

	/**
	 * 接口编号：208；【TMS_app】修改照片=》【TMS_web】同步
	 * 
	 * @param transferDataSyn000208
	 */
	public void executeTransferDataSyn000208(TransferDataSyn000208 transferDataSyn000208) throws TmsDaoException {
		logger.info("executeTransferDataSyn000208, photo1: " + transferDataSyn000208.getPhoto1());
		
		String photo1 = transferDataSyn000208.getPhoto1();
		String photo2 = transferDataSyn000208.getPhoto2();
		String photo3 = transferDataSyn000208.getPhoto3();
		String photo4 = transferDataSyn000208.getPhoto4();
		String photo5 = transferDataSyn000208.getPhoto5();
		String photo6 = transferDataSyn000208.getPhoto6();
		String photo7 = transferDataSyn000208.getPhoto7();
		String photo8 = transferDataSyn000208.getPhoto8();

		// 存放图片绝对地址
		String imgFilePath = TmsConstants.CAR_COLLECTION_PIC_DIRECTORY;
		String imgFileName = TmsConstants.CAR_COLLECTION_PIC_URL;
		String imgDownload = TmsConstants.APP_MQ_IMG_DOWNLOAD;

		// 车辆照片
		if (photo1 != null && !photo1.isEmpty()) {
			String photo_1 = photo1.substring(photo1.indexOf(imgDownload));
			ImageUtils.httpDownload(photo1, imgFilePath.replaceAll(imgFileName, "") + photo_1);
			photo1 = photo_1;// imgFileName+photo1FileName;//保存到数据库的照片路径
		}
		if (photo2 != null && !photo2.isEmpty()) {
			String photo_2 = photo2.substring(photo2.indexOf(imgDownload));
			ImageUtils.httpDownload(photo2, imgFilePath.replaceAll(imgFileName, "") + photo_2);
			photo2 = photo_2;
		}
		if (photo3 != null && !photo3.isEmpty()) {
			String photo_3 = photo3.substring(photo3.indexOf(imgDownload));
			ImageUtils.httpDownload(photo3, imgFilePath.replaceAll(imgFileName, "") + photo_3);
			photo3 = photo_3;
		}
		if (photo4 != null && !photo4.isEmpty()) {
			String photo_4 = photo4.substring(photo4.indexOf(imgDownload));
			ImageUtils.httpDownload(photo4, imgFilePath.replaceAll(imgFileName, "") + photo_4);
			photo4 = photo_4;
		}
		if (photo5 != null && !photo5.isEmpty()) {
			String photo_5 = photo5.substring(photo5.indexOf(imgDownload));
			ImageUtils.httpDownload(photo5, imgFilePath.replaceAll(imgFileName, "") + photo_5);
			photo5 = photo_5;
		}
		if (photo6 != null && !photo6.isEmpty()) {
			String photo_6 = photo6.substring(photo6.indexOf(imgDownload));
			ImageUtils.httpDownload(photo6, imgFilePath.replaceAll(imgFileName, "") + photo_6);
			photo6 = photo_6;
		}
		if (photo7 != null && !photo7.isEmpty()) {
			String photo_7 = photo7.substring(photo7.indexOf(imgDownload));
			ImageUtils.httpDownload(photo7, imgFilePath.replaceAll(imgFileName, "") + photo_7);
			photo7 = photo_7;
		}
		if (photo8 != null && !photo8.isEmpty()) {
			String photo_8 = photo8.substring(photo8.indexOf(imgDownload));
			ImageUtils.httpDownload(photo8, imgFilePath.replaceAll(imgFileName, "") + photo_8);
			photo8 = photo_8;
		}

		CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
				.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
		MarketCarInfoDto marketCarInfoDto = collectCarInfoDao
				.findMarketCarInfoBySerial(transferDataSyn000208.getSerial());
		if (marketCarInfoDto != null) {

			int id = marketCarInfoDto.getId();
			MarketCarInfoDto updateCar = new MarketCarInfoDto();
			updateCar.setId(id);
			updateCar.setPhoto_1(photo1);
			updateCar.setPhoto_2(photo2);
			updateCar.setPhoto_3(photo3);
			updateCar.setPhoto_4(photo4);
			updateCar.setPhoto_5(photo5);
			updateCar.setPhoto_6(photo6);
			updateCar.setPhoto_7(photo7);
			updateCar.setPhoto_8(photo8);

			collectCarInfoDao.updateMarketCarInfoPhotoByID(updateCar);
		}
	}

	/**
	 * 接口编号：209；【TMS_app】信息修改=》【TMS_web】同步
	 * 
	 * @param transferDataSyn000209
	 */
	public void executeTransferDataSyn000209(TransferDataSyn000209 transferDataSyn000209) throws TmsDaoException {

		CollectCarInfoImpl collectCarInfoDao = (CollectCarInfoImpl) CollectCarInfoImpl
				.getInstance(TmsDao.TMS_MARKET_CAR_INFO);
		MarketCarInfoDto marketCarInfoDtoByFind = collectCarInfoDao
				.findMarketCarInfoBySerial(transferDataSyn000209.getSerial());

		if (marketCarInfoDtoByFind != null) {

			int id = marketCarInfoDtoByFind.getId();
			MarketCarInfoDto updateCar = new MarketCarInfoDto();
			updateCar.setId(id);
			updateCar.setCatClass(Integer.parseInt(transferDataSyn000209.getCatClass()));
			updateCar.setVendorId(transferDataSyn000209.getVendorId());
			updateCar.setBrandId(transferDataSyn000209.getBrandId());
			updateCar.setCarStyleId(transferDataSyn000209.getCarStyleId());
			double mileage = Double.parseDouble(transferDataSyn000209.getMileage());
			updateCar.setMileage((int) mileage);
			updateCar.setPrice(transferDataSyn000209.getPrice());
			updateCar.setColor(transferDataSyn000209.getColor());
			updateCar.setRegDate(transferDataSyn000209.getRegDate());
			updateCar.setJqx(transferDataSyn000209.getJqx());
			updateCar.setYearCarefulPeriod(transferDataSyn000209.getYearCarefulPeriod());
			updateCar.setCompanyContactPerson(transferDataSyn000209.getContactPerson());
			updateCar.setCompanyContactPhone(transferDataSyn000209.getContactPhone());
			updateCar.setRemark(transferDataSyn000209.getRemarks());
			updateCar.setCarName(transferDataSyn000209.getCarName());
			updateCar.setUpdateUserId(1);
			collectCarInfoDao.updateMarketCarInfoByID(updateCar);
		}
	}

	
	/**
	 * 接口编号：102；【TMS_app】信息修改=》【TMS_web】同步
	 * 
	 * @param transferDataSyn000102
	 */
	public void executeTransferDataSyn000102(TransferDataSyn000102 transferDataSyn000102) throws TmsDaoException {
		logger.info("TransferDataSyn000102 info:" + transferDataSyn000102.toString()+ ", attnId=" + transferDataSyn000102.getAttnId());
		int userId = 0;
		String serial = transferDataSyn000102.getSerial();
		TransferAcceptedInfoDaoImp acceptInfo = (TransferAcceptedInfoDaoImp) TmsDao.getInstance(TmsDao.TMS_TRANSFER_ACCEPTED_INFO);
		String infoId = acceptInfo.getIdBySerial(transferDataSyn000102.getSerial());
		TransferAcceptedInfoDto dto = new TransferAcceptedInfoDto();
		if(transferDataSyn000102.hasCardType()) dto.setCardType(transferDataSyn000102.getCardType());
		dto.setSerial(serial);
		if(transferDataSyn000102.hasLicensePlate()) dto.setLicensePlate(transferDataSyn000102.getLicensePlate()); 
		if(transferDataSyn000102.hasVin()) dto.setVin(transferDataSyn000102.getVin());
		if(transferDataSyn000102.hasLicensePlateType() && StringUtils.isNotBlank(transferDataSyn000102.getLicensePlateType())) {
//			dto.setCy_cardType(Integer.parseInt(transferDataSyn000102.getLicensePlateType()));
			if("0".equals(transferDataSyn000102.getLicensePlateType())) {
				dto.setLicensePlateCol("2");
			}else if("1".equals(transferDataSyn000102.getLicensePlateType())) {
				dto.setLicensePlateCol("1");
			}
		}
		
		String imageType = "jpg";
		String imageDir = ImageUtils.getImageDirectoryPath(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY));
		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto1())) {
			ImageUtils.generateImageBase64(transferDataSyn000102.getInfoPhoto1(),imageDir+serial+"_1."+imageType);
			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_1."+imageType);
			dto.setPhoto_1(imageUrl);
		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getCarPic()))  {
//			ImageUtils.generateImage(transferDataSyn000102.getCarPic(),imageDir+serial+"_1."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_1."+imageType);
//			dto.setPhoto_1(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto1())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto1(),imageDir+serial+"_2."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_2."+imageType);
//			dto.setMaterialImages1(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto2())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto2(),imageDir+serial+"_3."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_3."+imageType);
//			dto.setMaterialImages2(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto3())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto3(),imageDir+serial+"_4."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_4."+imageType);
//			dto.setMaterialImages3(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto4())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto4(),imageDir+serial+"_5."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_5."+imageType);
//			dto.setMaterialImages4(imageUrl);
//		} 
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto5())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto5(),imageDir+serial+"_6."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_6."+imageType);
//			dto.setMaterialImages5(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto6())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto6(),imageDir+serial+"_7."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_7."+imageType);
//			dto.setMaterialImages6(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto7())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto7(),imageDir+serial+"_8."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_8."+imageType);
//			dto.setMaterialImages7(imageUrl);
//		}
//		if(StringUtils.isNotBlank(transferDataSyn000102.getInfoPhoto8())) {
//			ImageUtils.generateImage(transferDataSyn000102.getInfoPhoto8(),imageDir+serial+"_9."+imageType);
//			String imageUrl = ImageUtils.getImageUrl(Registry.getConfig(TmsConstants.WECHAT_PIC_URL_KEY)+serial+"_9."+imageType);
//			dto.setMaterialImages8(imageUrl);
//		}
		if(transferDataSyn000102.hasBusinessType())dto.setTransferType(Integer.parseInt(transferDataSyn000102.getBusinessType()));
//		if(transferDataSyn000102.hasInputProd() && StringUtils.isNumeric(transferDataSyn000102.getInputProd())) dto.setCarMarketInProv(Integer.parseInt(transferDataSyn000102.getInputProd()));
//		if(transferDataSyn000102.hasInputCity() && StringUtils.isNumeric(transferDataSyn000102.getInputCity())) dto.setCarMarketInCity(Integer.parseInt(transferDataSyn000102.getInputCity()));
		if(transferDataSyn000102.hasAttnId())dto.setAttnId(transferDataSyn000102.getAttnId());
//		if(transferDataSyn000102.hasCarClass()) dto.setCarClass(Integer.parseInt(transferDataSyn000102.getCarClass()));
//		if(transferDataSyn000102.hasCarName()) dto.setCarName(transferDataSyn000102.getCarName());
//		if(transferDataSyn000102.hasVendorId())dto.setVendorId(transferDataSyn000102.getVendorId());
//		if(transferDataSyn000102.hasBrandId()) dto.setBrandId(transferDataSyn000102.getBrandId());
//		if(transferDataSyn000102.hasCarStyleId()) dto.setCarStyleId(transferDataSyn000102.getCarStyleId());
//		if(transferDataSyn000102.hasIsMatch() ) dto.setIsMatch(Integer.parseInt(transferDataSyn000102.getIsMatch()));
		if(transferDataSyn000102.hasTransferPrice() ) dto.setTransferPrice(transferDataSyn000102.getTransferPrice());
		dto.setTransfer(2);//车主未审核
		dto.setTransferRegister(2);//公安审核
		TxController controller = TxController.getTxController();
		// 添加事务提交异常捕获
		try {
			controller.begin();
			if(transferDataSyn000102.hasAttnId() && StringUtil.isNotBlank(transferDataSyn000102.getAttnId())) {
				Attn attn = Attn.getInstance().findAttnByAttnId(transferDataSyn000102.getAttnId());
			 	UserDaoImp userDao = (UserDaoImp) CollectCarInfoImpl.getInstance(TmsDao.TMS_USER);
				UserDto user = userDao.findUserInfoByUserId(attn.getUserId(), 0);
				if(user!=null&& user.getId() > 0) {
					userId = Long.valueOf(user.getId()).intValue();
					dto.setUpdateUserId((int) user.getId());
					dto.setInsertUserid((int) user.getId());
				}
			}
			if (infoId != null) {
				acceptInfo.updateAcceptInfo000102(dto);
				TransferProcessHistoryDaoImp historyDao = (TransferProcessHistoryDaoImp) CollectCarInfoImpl.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
				TransferProcessHistoryDto historyDto1 = new TransferProcessHistoryDto();
				historyDto1.setSerial(serial);
				historyDto1.setBusinessType(1);
				historyDto1.setInsertUserId(userId);
				historyDao.insertHisInfoBySerial(historyDto1);
				TransferProcessHistoryDto historyDto2 = new TransferProcessHistoryDto();
				historyDto2.setSerial(serial);
				historyDto2.setBusinessType(2);
				historyDto2.setInsertUserId(userId);
				historyDao.insertHisInfoBySerial(historyDto2);
				TransferProcessHistoryDto historyDto3 = new TransferProcessHistoryDto();
				historyDto3.setSerial(serial);
				historyDto3.setBusinessType(8);
				historyDto3.setInsertUserId(userId);
				historyDao.insertHisInfoBySerial(historyDto3);
				//
				int price = transferDataSyn000102.getPrice();
				TransferFinanceDetailDto transferFinanceDetailDto = new TransferFinanceDetailDto();
				transferFinanceDetailDto.setSerial(serial);
				transferFinanceDetailDto.setPrice(price);
				transferFinanceDetailDto.setPriceType(9);
				transferFinanceDetailDto.setPriceChargeType(3);
				if(transferDataSyn000102.hasAttnId() && StringUtil.isNumber(transferDataSyn000102.getAttnId())) {
					transferFinanceDetailDto.setPriceUserId(Integer.parseInt(transferDataSyn000102.getAttnId()));
				}
				transferFinanceDetailDto.setPriceDate(DateUtil.getCurrentTime());
				transferFinanceDetailDto.setPriceRemark("代办人缴费");
				TmsTransferFinanceDetailDao dao = (TmsTransferFinanceDetailDaoImp) TmsDao.getInstance(TmsDao.TMS_TRANSFER_FINANCE_DETAIL);
				dao.insertTransferFinanceDetail102(transferFinanceDetailDto);
				
				//
				if(transferDataSyn000102.hasAttnId() && StringUtil.isNotBlank(transferDataSyn000102.getAttnId())) {
					AttnDao uDao = (AttnDao) TmsDao.getInstance(TmsDao.TMS_ATTN);
					uDao.updateAttnVirtualMargin(price, transferDataSyn000102.getAttnId());
				}
			} else {
//				acceptInfo.saveAcceptInfo000102(dto);
//				TransferProcessHistoryDaoImp historyDao = (TransferProcessHistoryDaoImp) CollectCarInfoImpl.getInstance(TmsDao.TMS_TRANSFER_PROCESS_HISTORY);
//				TransferProcessHistoryDto historyDto1 = new TransferProcessHistoryDto();
//				historyDto1.setSerial(serial);
//				historyDto1.setBusinessType(1);
//				historyDto1.setInsertUserId(userId);
//				historyDao.insertHisInfoBySerial(historyDto1);
//				TransferProcessHistoryDto historyDto2 = new TransferProcessHistoryDto();
//				historyDto2.setSerial(serial);
//				historyDto2.setBusinessType(2);
//				historyDto2.setInsertUserId(userId);
//				historyDao.insertHisInfoBySerial(historyDto2);
//				TransferProcessHistoryDto historyDto3 = new TransferProcessHistoryDto();
//				historyDto3.setSerial(serial);
//				historyDto3.setBusinessType(8);
//				historyDto3.setInsertUserId(userId);
//				historyDao.insertHisInfoBySerial(historyDto3);
//				//
//				int price = transferDataSyn000102.getPrice();
//				TransferFinanceDetailDto transferFinanceDetailDto = new TransferFinanceDetailDto();
//				transferFinanceDetailDto.setSerial(serial);
//				transferFinanceDetailDto.setPrice(price);
//				transferFinanceDetailDto.setPriceType(12);
//				transferFinanceDetailDto.setPriceChargeType(3);
//				transferFinanceDetailDto.setPriceUserId(1);
//				transferFinanceDetailDto.setPriceDate(DateUtil.getCurrentTime());
//				transferFinanceDetailDto.setPriceRemark("代办人缴费");
//				TmsTransferFinanceDetailDao dao = (TmsTransferFinanceDetailDaoImp) TmsDao.getInstance(TmsDao.TMS_TRANSFER_FINANCE_DETAIL);
//				dao.insertTransferFinanceDetail102(transferFinanceDetailDto);
//				
//				//
//				if(transferDataSyn000102.hasAttnId() && StringUtil.isNotBlank(transferDataSyn000102.getAttnId())) {
//					AttnDao uDao = (AttnDao) TmsDao.getInstance(TmsDao.TMS_ATTN);
//					uDao.updateAttnVirtualMargin(price, transferDataSyn000102.getAttnId());
//				}
			}
			controller.commit();
		} catch (Exception e) {
			logger.error(TmsException.DB_TXCRROR, e);
			try {
				controller.rollback();
			} catch (TransactionException e1) {
				logger.error(TmsException.DB_TXCRROR, e1);
			}
		}
		
	}
	

	
	public void executeTransferDataSyn1210(TransferDataSyn1210 data) throws TmsDaoException {
		Car car = Car.getInstance();
		//库存车辆信息表更新
		car.updateCarBarCodeNum(data.getSerial(), data.getBarCodeNum());
		
		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		MarketCarHandleDto marketCarHandleDto = new MarketCarHandleDto();
		marketCarHandleDto.setSerial(data.getSerial());
		marketCarHandleDto.setHandleType(15);
		marketCarHandleDto.setIsPush(1);
		marketCarHandleDto.setPushContent(data.getPushContent());
		marketCarHandleDto.setPhoto("");
		marketCarHandleDto.setUpdateUserId(1);
		marketCarHandleDto.setUpdateTime(new Timestamp(new Date().getTime()));
		marketCarHandleInfoDao.insertCarHandleInfo(marketCarHandleDto);
	}
	
    public void executeTransferDataSyn1211(TransferDataSyn1211 data) throws TmsDaoException {
    	Car car = Car.getInstance();
    	car.setSerial(data.getSerial());//车辆编号	
		car.setTmpStorageTime(DateUtil.getStringToTimeStamp1(data.getTmpStorageTime()));
		car.setTmpEnterTime(DateUtil.getStringToTimeStamp1(data.getTmpEnterTime()));
		//更新 库存车辆信息表（tms_market_car_info）
		car.updateTmpStorageEnterTime(car);
		
		MarketCarHandleInfoDao marketCarHandleInfoDao = (MarketCarHandleInfoDao) TmsDao.getInstance(TmsDao.TMS_MARKET_CAR_HANDLEINFO);
		MarketCarHandleDto marketCarHandleDto = new MarketCarHandleDto();
		marketCarHandleDto.setSerial(data.getSerial());
		marketCarHandleDto.setHandleType(15);
		marketCarHandleDto.setIsPush(1);
		marketCarHandleDto.setPushContent(data.getPushContent());
		marketCarHandleDto.setPhoto("");
		marketCarHandleDto.setUpdateUserId(1);
		marketCarHandleDto.setUpdateTime(new Timestamp(new Date().getTime()));
		marketCarHandleInfoDao.insertCarHandleInfo(marketCarHandleDto);
	}
    
}
